Winscope
Article : Andy Collinson
Email  :

Overview
Most people will not have access to a electronics laboratory or be able to afford an oscilloscope, so here is an alternative. Winscope is a software application that will use your sound card to sample input waveforms and display results. The Oscilloscope allows you to study any signal in real time, measure frequencies, study realtime signal spectra and plot Lissajous patterns. In addition, winscope also has a storage facility and has a powerful FFT (fast fourier transform) routine, which enables winscope to act as a spectrum analyzer.

There are some drawbacks however with winscope, mainly:
- non-calibrated amplitude level (difficult to use as digital multimeter)
- relatively low bandwidth (20 Hz - 20 kHz)
- possibility of damage of a PC when connecting to an unknown signal source. (See Warnings).

Warning:
OSCILLOSCOPE IS SUPPLIED TO YOU AS IS, AND IN NO CASE THE AUTHOR OF OSCILLOSCOPE IS RESPONSIBLE FOR PERSONAL INJURY, HARDWARE AND/OR DATA DAMAGE, PROPERTY DAMAGE OR PROFIT LOSS ARISING FROM USE OR INABILITY TO USE THE OSCILLOSCOPE. THE AUTHOR DOES NOT GUARANTEE THE FITNESS OF OSCILLOSCOPE FOR ANY PARTICULAR PURPOSE. OSCILLOSCOPE IS NOT INTENDED FOR INDUSTRIAL OR COMMERCIAL USE. IN GENERAL, USE OSCILLOSCOPE AT YOUR OWN RISK.
ALWAYS CONSULT YOUR SOUND CARD MANUAL FOR DETAILS ON CONNECTING TO EXTERNAL DEVICES.
General Information
Winscope 2.51 is designed by Konstantin Zeldovich and he has graciously distributed it as freeware. It was wrote for windows 95 but works happily on windows XP and Windows Me. I have not tested it on Windows 7 or Windows Vista. It does however work perfectly on linux, using wine.
Specifications
Dual trace digital storage oscilloscope with realtime spectrum analyzer and correlometer.
Buffer length: 52 ms
Bandwidth: 20 Hz - 20 kHz max
Input level: about 2 VAC, limited by sound card capabilities
Display refresh: ca. 6 fps
Data export: disk file or Windows clipboard, text format

Safety measures when using Oscilloscope
Being software, Winoscope itself cannot damage your hardware, but it is very easy to burn out at least your sound card when trying to investigate some signal with unknown amplitude and DC offset. So, you must always be extremely careful when establishing an electrical connection between your computer and external equipment. It may be a good practice to use first a conventional multimeter or oscilloscope to find out whether signal levels are acceptable for your sound card.
It is safe to connect to any audio/video equipment using standard line-in jacks and cables. You may consider using an old tape recorder, amplifier or turntable as a buffer device between your sound card and non-standard signal source. This can save your computer in case of a poorly grounded, unstable singal source, as well as allow you to control signal level manually before it reaches the sound card. To avoid personal injury, always follow the usual safety rules when working with electric circuits.

Getting Started with Winscope
After downloading winscope, which comes as a .ZIP file unzip it and read the help file that is distributed with the program. To start, first make sure your sound cards microphone input is selected for recording. Click on the first triangle ("play") button and speak into your pc microphone. You should now see a speech waveform displayed on winscope. If no waveform appears increase the volume slider on the microphone input.
You can also record from the line input, but the signal source must be about 50mV RMS. If no waveform is seen increase the line input slider. To freeze plots, click Hold ("pause") button. Below is a screenshot of Winscope displaying a 600Hz sine waveform:-



The input to winscope depends on your sound cards connectors, but most have 3.5mm stereo sockets. I made a lead using a 3.5mm stereo jack plug and screened audio cable, (low capacitance cable is best) connected to crocodile clips. If you have a computer with built in microphone, then you can also use the microphone to directly display a wave form of your voice.
One of the nice features about Winscope is the FFT button. A spectrum analyzer costs even more than an oscilloscope, but with winscope and your computer you can improvise. A spectrum analysis of the above sine wave produced the following result:



The input samples are either in 5ms or 50ms which are good for audio frequencies. A later version of this program may be available, but this version is user friendly and a worthwhile addition to anyone's collection of test equipment.

Probes for Mic and Line Input
The line and mic inputs for your sound card are stereo and have left and right inputs. In dual trace the left channel will be the X trace and right channel Y trace on winscope. The maximum input amplitude should never be higher than 10mV for a Mic input and 2Volt for the line input. Some resistive probes can be made as shown below.



In all cases it is advisable to check with a high impedance multimeter set to the highest range on both DC and AC volts that the circuit under test has the same ground potential as your sound card. Just use a meter as shown above and measure between circuit ground and sound card ground, the reading should always be zero.

Winscope Controls
Meter button
Clicking the Meter button toggles Meter mode on and off. In Meter mode, you can measure time and level of a waveform simply by clicking left and right mouse buttons on the Oscilloscope display. Left button click sets cursor 1 and right click sets cursor 2. When both cursors are set, the difference between the cursors positions is shown in the right three parts of the status bar. For convenience, the reciprocal value of time/frequency difference is shown in the 1/dt (1/dF) status window. This allows, for example, to quickly measure the frequency of a wave by clicking left and right buttons on the successive maximums and looking at 1/dt value. Note: ADC levels are integer; the decimal parts you see are interpolated values.

Spectrum Analyzer (FFT)
The spectrometer is activated by clicking the FFT button or appropriate menu command. It displays the amplitude spectrum of signal in Y1 channel as Y1 channel and optionally the phase curve as Y2 channel. Use YT Single Trace mode to display only amplitude spectrum or YT Dual Trace to display both amplitude and phase curves.

The phase is defined by Φ = atan2( Im(F),Re(F) ), -π < Φ < π

The spectrometer is fully compatible with Store and Meter commands. Phase is measured in radians, and amplitude in arbitrary units. To control the appearance of the spectra, use ms/div switch and T slider to change frequency scale, and Y1, Y2, Pos Y1 and Pos Y2 sliders to adjust gain and vertical position of the plots. The software gain of power density spectrum is proportional to the product of the levels of Y1 and Y2 sliders, resulting in both convenient faster-than-linear response (if Y1=Y2 is set) and fine adjustment by a single slider. The amplitude of the phase curve is controlled by Y2 slider alone. Pos Y1 and Pos Y2 sliders govern the vertical position of amplitude and phase spectra respectively.

Store button (S)
Clicking the Store button turns storage mode on. In this mode, Oscilloscope works like a storage oscilloscope, when every trace plotted remains on the screen. Storage mode can be used either in ON LINE or HOLD modes. To clear the screen, click the Store button once more. In storage mode you can not, however, recall the waveform recorded previously and record it in the file, because only the display picture is stored and not the raw data. This allows to use storage mode for any desired period of time without worrying of overflow errors.
More help can be found be clicking the Help menu on winscope.

Winscope on Linux
Winscope also works and is fully functional on linux. See screenshot on PCLinuxOS 2009 below, (click to zoom):



Installation under linux is easy, first make sure that you have the "wine" and "unzip" packages installed. This is generally in the repositories of most linux distributions, see below.
Installation instructions for RPM based distros (Suse, Fedora, Mandriva, etc)
yum install wine unzip     (or)
rpm -Uvh wine unzip
After wine and unzip have been installed, make a directory called winscope in your home directory:
mkdir ~/winscope Download winscope to this location and unzip it: cd ~/winscope
unzip scope.zip
You will now see 3 files: README.TXT WINSCOPE.EXE WINSCOPE.HLP
To run winscope use the command:
wine WINSCOPE.EXE

Installation instructions for apt based distros (Ubuntu, Debian, Mint, etc
apt-get install wine unzip     (or)
For distros that use the graphical front end Synaptic (i.e. PCLinuxOS, Ubuntu, Debian just search for wine and unzip)
After wine and unzip have been installed, make a directory called winscope in your home directory:
mkdir ~/winscope Download winscope to this location and unzip it: cd ~/winscope
unzip scope.zip
You will now see 3 files: README.TXT WINSCOPE.EXE WINSCOPE.HLP
To run winscope use the command:
wine WINSCOPE.EXE


Depending on your linux distribution you may be using either KDE or Gnome Desktop (but there are many others). If using KDE just bring up kmix and check the record button for your desired input, see below.



You need to click the input tab, then click line or mic. Similar mixers exist for the popular Gnome desktop as well.


Similar menu editors are available for other desktops, but if using KDE just right click the K menu button and select menu editor, screenshot below:



You can create a new sub folder first if you want, then select new item. Give it the title Winscope, select an appropriate icon and then fill in the launch command. As this was created in the home folder under winscope directory, the command is simply:
wine ~/winscope/WINSCOPE.EXE

Please note the the "tilde" ~ symbol represents /home/username so ~/winscope is the same as /home/andy/winscope etc. The case has to be correct, as winscope was in capitals, the launcher will not work if you make a spelling mistake. Finally, that's it, test your item from your desktop menu, it really is that easy to add new software in linux.