home *** CD-ROM | disk | FTP | other *** search
/ World of Ham Radio 1997 / WOHR97_AmSoft_(1997-02-01).iso / misc / ve2iq / amsoft.iii next >
Text File  |  1997-02-01  |  14KB  |  219 lines

  1. AUDIO SPECTRUM ANALYZER SYSTEM - - - VE2IQ.
  2. ------------------------------------------
  3.  
  4. (Special preview at Cote St-Luc fleamarket, Oct. 19th, 1991. Watch for the
  5. complete technical article to appear in upcoming issue of QST (Jan '92)).
  6.  
  7.     The board you have purchased (or constructed) goes between your rig's
  8. audio output jack and your computer.  You must supply the connecting cables.
  9.  
  10.     Audio input should nominally be 400 millivolts RMS.  The circuit will
  11. overload and clip if you put in more than 600 millivolts (1.2 volts
  12. peak-to-peak).  The input impedance is 20 K ohms resistive, so it will not
  13. load down your rig's audio output driver.  Normally the audio is AC-coupled,
  14. and referenced to halfway between the 6-volt regulated supply and ground.  If
  15. you overdrive the interface and clipping does occur, you will notice a strong
  16. DC component appearing in the spectrum.  (Clipping causes the ADC to return
  17. constant numbers at plus or minus limit value, and the FFT program interprets
  18. these constant values as a DC component).  If you cannot obtain audio at a con-
  19. stant level, then start at a low level, viewing the spectrum on the screen
  20. with the Automatic Software AGC disabled (see below).  While listening to a
  21. normal off-the-air signal, crank up the audio level until the display fills
  22. approximately two-thirds of the vertical scale, or until signs of clipping are
  23. noticed.
  24.  
  25.     Electrical connections...  The interface board requires at least 9
  26. volts DC to operate, and draws approximately 15 milliamps.  It is convenient
  27. to use a standard 9-volt Alkaline battery to power the unit, but you may also
  28. draw the power from any other D.C. source around the shack, e.g. the 13.6 volt
  29. rig supply, or a 12-volt gel-cell, etc. etc.  The D.C. supply is regulated
  30. down to +6 volts on the board.  The board contains a charge-pump to generate
  31. the negative voltage required to power the RS232 signal going to your comput-
  32. er's COM1 serial port.  The RS232 output from the interface board goes via a
  33. twisted pair (not necessarily shielded) cable to the computer's COM1 port.
  34. Only two wires are used: signal and ground.  If your computer uses a 25-pin
  35. RS232 connector, then wire the RS232 output from the ASA interface to pin 3,
  36. "Received Data", and use pin 7 as the signal ground.  (If your computer uses a
  37. 9-pin connector, then "Received Data" will be on pin 2, signal gnd on pin 5.)
  38.  
  39.     The interface board must be connected to your computer's COM1 serial
  40. port and running (powered up) - before you start the FFT program, otherwise
  41. you will get an error message saying there is no response from serial port.
  42.  
  43.     Software...
  44.  
  45.     There are several versions of the Audio Spectrum Analyzer program on
  46. this disk.  The most basic version is called FFT.COM.  Use it if you have an
  47. EGA/VGA display.  If you have a Hercules Graphics monochrome display, use the
  48. program called FFTH.COM. These programs are identical otherwise, it's just
  49. that one works with EGA/VGA, the other has a driver for Hercules mono graphics
  50. card.  These programs should work with just about any IBM PC compatible compu-
  51. ter.  You don't need a lot of memory, and the computer doesn't have to be very
  52. fast, and you don't need a math co-processor.  All you need is DOS 3.0 or
  53. higher, a graphics adaptor, and a COM1 serial port.  It is suggested not to
  54. run other "terminate and stay resident" software concurrently with the Audio
  55. Spectrum Analyzer, because the Fast Fourier Transform is compute intensive -
  56. it will keep your computer real busy!  If other programs are stealing cycles,
  57. your computer may not be fast enough to keep up.  If you get an error message
  58. that says there is an overrun on the serial port, it indicates that for one
  59. reason or another, your computer cannot keep up with the high speed flow of
  60. digitized data from the ASA interface card.  I have verified that everything
  61. works fine on an XT clone running at 4.77 Mhz (with the Turbo mode disabled),
  62. and that is about as slow as they get, so it should run ok on your machine.
  63. It is important to make sure there are no other "hidden" programs running
  64. which you may have forgotten about.  For example, do not invoke the DOS print
  65. spooler, and if it has been invoked, then you may have to re-boot to get rid
  66. of it - this utility hangs around in memory and steals cycles from whatever
  67. other programs happen to be running, thus slowing them down.  It is easy to
  68. overlook the fact that PRINT was invoked earlier and is still resident.
  69.  
  70.     If you have a very fast computer, chances are it will easily be able
  71. to handle the calculations required without any overrun.  If this is the case,
  72. you may wish to use the "X" versions of the above programs,  FFTX and FFTXH
  73. respectively.  These expanded versions may not run on some slower computers,
  74. though.  If you are not sure if your computer is fast enough to run the "X"
  75. versions, it can't hurt to try them anyway.  You will get "overrun"  messages
  76. if the machine can't keep up.  FFTX allows you to capture data to a diskfile
  77. for later, detailed analysis.  Up to one minute of coherently sampled data
  78. may be captured in real-time and saved to a diskfile.  A hard disk is recom-
  79. mended for this.  Remember that in single precision mode (one byte per digital
  80. sample), it still needs 7200 bytes of disk space for EACH SECOND of audio!
  81. You can use up a lot of disk space in a short time this way, hi!  The format
  82. of the recorded images on disk is straight binary.  You may play back pre-
  83. recorded sessions into FFTX at any time.  FFTX also supports another format,
  84. where 16-bit words are used instead of bytes (Double precision storage mode).
  85. There is no reason to use it with the ASA interface board, because the little
  86. board only digitizes the audio to 8-bit resolution anyway.  The double precis-
  87. ion mode is available in the software to accommodate possible future
  88. versions of the interface that may sample more often and digitize the samples
  89. to more than 8 bits.  To use the capture to disk feature, invoke the FFTX pro-
  90. gram with "FFTX CAPTURE" - and answer the resulting questions. 
  91.  
  92.     There is a program called LOOKSEE.COM which may be on your diskette.
  93. This is not really part of the audio spectrum analyzer system, but is compat-
  94. ible with the stored data format (either single or double precision) produced
  95. by the FFTX program.  LOOKSEE allows you to examine the data in the "TIME
  96. DOMAIN" - it emulates an analog storage scope on the EGA/VGA screen.  At this
  97. time (October '91), there is only one version of LOOKSEE available.  It needs
  98. EGA/VGA graphics, and a very fast computer.  A math co-processor is also
  99. required, and still the response can be pretty slow sometimes!  LOOKSEE allows
  100. you to move a window through the data samples stored on disk and to view the
  101. resulting waveform just like on an oscilloscope.  You would see exactly the
  102. same image if you were viewing the audio from your radio on a conventional
  103. scope when it was recorded by FFTX.  The only difference is that the signal
  104. is frozen in time, you can look at a given "screenful" for as long as you
  105. like, then move on to the next sequential part of the waveform, etc.  The
  106. idea is similar to "freeze frame" in a VCR.  The numbers at bottom of the
  107. screen show the range of sample numbers which are currently being displayed.
  108. Only five keys are active: <CR> terminates and gets you back to DOS.  The four
  109. arrow keys are also active.  Right arrow goes to next later part of the wave-
  110. form, left arrow takes you earlier in time.  Down arrow "Zooms in", Up arrow
  111. "Zooms out".  Down/Up arrows are equivalent to changing the time base sweep
  112. rate on a conventional oscilloscope.  The program is noticeably slow to do
  113. this "zoom" calculation unless you have a very fast computer, because it has
  114. to generate intermediate sample values (interpolation), in accordance with
  115. the Sampling theorem, using Whittaker's cardinal function.  When we sample
  116. at 7200 samples per second, as long as the audio input contains no frequency
  117. components at or above 3.6 Khz, there is no loss of information.  The comput-
  118. er is able to "reconstruct" what the waveform actually must have looked like,
  119. no matter how far you care to "zoom" in.  This "reconstruction" in software is
  120. what takes the time.
  121.  
  122.     How to run FFT.COM...
  123.  
  124. As mentioned above, do not invoke FFT unless you have the ASA interface board
  125. connected to the COM1 serial port and powered up, or else you will get an
  126. error message saying the serial data stream has dropped out, and this will
  127. abort the FFT program.  There are two ways to start FFT:  you can just type
  128. FFT (and then when the program is loaded, it will ask you to answer a bunch
  129. of questions) - or you can type FFT GO, which will tell the program to use all
  130. the default answers and get a picture on the screen right away.  The first
  131. time you try it, use the FFT GO command, just to make sure everything is
  132. hooked up and working OK.
  133.  
  134. If you want to vary some of the variables, you can invoke the program without
  135. the "GO" command line parameter.  In this case the program will ask you to
  136. make some choices:
  137.  
  138.     SAMPLES PER SECOND [7200]:    (FFTX only)
  139. This program can handle data that was sampled at any rate, but the ASA inter-
  140. face only samples at 7200 samples per second, so that is the default value.
  141. If you have a diskfile of data that was generated with some other high speed
  142. ADC board, and you know the sample rate, you can use FFTX to analyze it.
  143.  
  144.     FFTLENGTH [512]:
  145. The FFT length determines how many samples the program takes in before it does
  146. the FFT (Fast Fourier Transform) calculation.  In order to get a lot of freq-
  147. uency resolution (i.e. to distinguish between two frequency components which
  148. are close together) - the program needs more samples.  The trade-off is that
  149. it takes longer to acquire those samples (at the constant rate of 7200 samples
  150. per second), and the computation also slows down noticeably for long FFT's.
  151. Keep in mind that the horizontal resolution of an EGA/VGA display is only 640
  152. pixels, and we use a few of those at the left of the screen for the vertical
  153. axis labelling, so only about 600 individual spectral lines can be shown, then
  154. we run out of pixels anyway.  The number of spectral lines available will be
  155. one half the FFT length.  This program (FFT or FFTX) can handle FFT's up to
  156. 4096 points, or with a fine frequency resolution of 2048 lines, these lines
  157. spaced 1.75 Hz apart.  Obviously we cannot display 2048 spectral lines on a
  158. 640-pixel horizontal resolution display, so something has to give.  What hap-
  159. pens is that you may also choose a limited range of frequencies to view, in-
  160. stead of looking at the whole spectrum from DC to 3.6 Khz.  For example, if
  161. you are only interested in signals around 800 Hz, you might ask to view the
  162. spectrum between 750 Hz and 850 Hz, in which all the available spectral lines
  163. could be displayed.  If you still ask for more lines than can be physically
  164. shown on the display, the program will throw out some spectral lines in order
  165. to fit the resulting display on the screen.  The default FFT length of 512
  166. points has been found to be a good all-around compromise.  It makes a nice
  167. display and fits the whole spectrum on the screen at once.
  168.  
  169.     NAME OF .AUD FILE:
  170. If you get this far and you still want to look at REAL-TIME data coming in via
  171. the COM1 serial port, you can answer this with "SERIAL".  Otherwise, give the
  172. name of a diskfile containing previously-recorded data.  The default suffix
  173. for files of this type is .AUD.
  174.  
  175.     LOWEST, HIGHEST FREQUENCIES OF INTEREST: [0..3600]:
  176. If you just enter a <CR> here, the default range (DC through 3.6Khz) will be
  177. used.  If you want to enter a more restrictive range of frequencies, you may
  178. enter two (2) numbers, separated by a single space and followed by <CR>.  The
  179. first number is the lower frequency limit in Hertz, the second number is the
  180. upper frequency limit.  The resulting display may not be scaled exactly the
  181. way you asked for it, but it should at least include the spectral lines within
  182. your requested limits.
  183.  
  184.     SPOT, INTEGRATE, CONTINUOUS[C]:
  185. SPOT - this does one FFT, then pauses for user acknowledgment.  Enter <CR> to
  186. go on and do another FFT.  Enter Q <CR> to Quit.
  187. INTEGRATE - this mode sums up a whole bunch of consecutive FFT's and shows
  188. the resulting averaged spectrum on the screen.  It is useful for looking at
  189. passband response of IF filters, etc, using only noise (presumed flat) as the
  190. signal input.  Kill the mode with a <CR>.
  191. CONTINUOUS - This is a real-time display of the spectrum as it is happening.
  192. As the audio signal source changes, the spectral display will change.  Use
  193. <CR> to quit the program.
  194.  
  195.     SOFTWARE AGC [Y]:
  196. Software AGC attempts to fill the screen vertically even though there may be
  197. very little signal energy available.  It is like AGC action in your radio.
  198. When the station you are watching goes QRT, the "grass" at the bottom of the
  199. screen will grow, and you may start to see components in there that are picked
  200. up from the computer, the wires around the shack, etc.  The actual amplitudes
  201. of such weak signals in the shack may be miniscule, but the software AGC will
  202. blow everything up to fill the screen, and this could give misleading results.
  203. The default choice (AGC enabled) - is good for just tuning around looking at
  204. stuff you get off the air.  Any strong signal will cause the AGC action to 
  205. suppress the grass (noise) at bottom on the screen.  Turn off the Software AGC
  206. if you want to make calibrated comparisons, e.g. to compare the amplitude of
  207. two signals on an absolute scale.
  208.  
  209. 73 & Good viewing de VE2IQ.
  210.  
  211. Watch for upcoming article in QST (January or February issue, I hope) -talk-
  212. ing about this system in more detail.  The article should explain pretty well
  213. how the FFT algorithm works, for those who are interested in such things.
  214.  
  215. Circuit boards will be available to QST readers for $24 US, and the software
  216. will also be available from Compuserve and possibly other bulletin boards.
  217. The program source code will be available to readers of QST for a nominal
  218. fee.
  219.