Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
Spectrum Cursor Peak
When the Peak option is active and a trace cursor is over a spectral peak, the spectral lines on either side of the peak are used to compute the true peak position and amplitude. The cursor X-readout will show a '^' symbol to the left of the computed value; this will be missing if the cursor is not over a peak. (For drifting or variable signal frequencies, Track mode will keep the solid cursor over the largest peak.)
You can toggle the Peak option at any time via the ALT+6 accelerator key. As a reminder, note the ^ symbol appears on the top-row '6' key and looks like a tiny peak.
Peak mode typically boosts the peak amplitude and frequency resolution of the 1024-sample spectrum to that of 65536 samples or more, without the attendant time lag otherwise required to acquire and process the extra samples. (But see the two Caution sections later in this topic.)
The normal frequency resolution of an FFT spectrum is given by the sample rate divided by the number of samples, so for a 48000 Hz sample rate, Daqarta's 1024-sample spectrum has spectral lines spaced every 46.875 hertz. If the true signal frequency falls between these lines, the resultant spectrum shows leakage: The true energy is spread among adjacent lines to give spectral "skirts".
Window functions are commonly applied in such cases to reduce the spread of the skirts and concentrate the energy in the lines nearest to the true peak. This allows a better measurement of the true peak amplitude, but does nothing to enhance knowledge of its actual frequency.
However, if the signal is known to contain only a single frequency, then there is a precise correspondence between the leakage components and the true spectral peak. From the components on either side, the location and amplitude of the true peak can be accurately interpolated.
Of course, most signals will have more than one frequency present. Nonetheless, the same interpolation process will still give greatly improved resolution as long as there is a reasonable separation between the signal frequencies. If they are too close together, the interpolation of a peak based upon its leakage components will be biased by added energy from leakage components of the nearby peak.
It turns out that the Peak interpolation will almost always improve the measurement, right up to the point where the two signal frequencies fall into the resolution width of the same raw spectral line.
This brings up the question of how to tell if an apparent spectral peak actually results from two or more closely spaced signal frequencies. In general, you can't tell without going to a larger FFT spectrum size. But with an ongoing real-time spectrum display you can usually tell quite easily if there are two frequencies that are very close, because they will "beat" together: The apparent single spectrum peak will bounce up and down at the difference frequency. This doesn't work so well if the two signals are more than several hertz apart, since the bouncing becomes too fast; it just looks like normal trace-to-trace variation.
You are encouraged to explore this phenomenon for yourself using the Daqarta Generator. Use two streams on the same channel, and set each to 50% Level or less (so their sum doesn't exceed 100%). Set the frequencies very close, and watch the beats. Move them a little farther apart, but still within one spectral line, until the beats are not obvious... just a flutter in the skirts. Move them still farther apart until you see separate spectral peaks, set a cursor on each, and try the Peak option. Since you know the actual frequencies that you set, you can see how close the Peak interpolation comes for any given peak separation.
CAUTION: You should use the Peak option only where there are known ordinary spectral peaks that you want to resolve. If applied to noise alone, or to chirps, sweeps, or other non-stationary signals, serious errors can result. To understand how this happens, set the Generator to produce a White noise and average the spectrum for 32 frames or so. You will see a ragged spectrum at the average noise level. But with Peak active you will see spikes well above this level at the cursor positions, which will follow along as you move the cursors.
The problem is that with a noisy signal, the Peak interpolator often finds a peak near the cursor, simply due to the random amplitudes of adjacent spectral lines. And since the noise level is high, the computed peak is higher still... sometimes almost twice the average noise level. Averaging more frames to get a smoother spectrum may reduce the number of cursor positions that are reported as peaks, but it doesn't reduce the computed peak amplitude. That's because the interpolator may think that nearly-equal adjacent lines are the spectral skirts of a peak that is nearly midway between the line frequencies.
CAUTION: The Peak option exhibits aliasing errors at low frequencies, especially when the true frequency falls between 0 and the first FFT spectral line. The problem is that some spectral leakage components represent negative frequencies, but they are reflected back up from zero and look like ordinary positive frequencies to the interpolation algorithm.
A true frequency that is below the first FFT line is thus reflected about that line by the peak interpolator, and is reported as being above the line by the same amount it is actually below it. Window functions are unable to reduce the negative leakage frequencies in this region, so they don't help accuracy.
At true frequencies that are higher than the first line, the contribution from negative leakage frequencies is less, so the error falls off with increasing frequency. A Window function can greatly improve accuracy in this region.
Hence, use extreme caution with the Peak option at the lowest frequencies.
The upshot of these cautions is that Peak mode is a special-purpose tool, not something to leave on all the time.
Note that for certain signals the Frequency Counter can provide better frequency resolution than the cursor Peak mode, and it also allows an extra-large numerical readout that can be independently positioned. The Frequency Counter depends upon reliable Trigger operation, which requires simple signals with a single major frequency. It may be difficult to get a reliable trigger at high frequencies (over 10 kHz), but the counter has superb resolution down to the lowest frequencies, limited only by the AC coupling of the sound card. With a repeating pulse or burst that can pass the AC coupling, the lower limit can be many seconds, even hours, per cycle.
Also note that although the height of a peak is increased by interpolation, this does not affect the Sigma readout of the total energy between cursors. Consider the same signal viewed on an uninterpolated spectrum with 64 times as many lines. Where the raw Daqarta spectrum shows a single line with a certain value, the new spectrum would show 64 lines... but they would have the same average value as the equivalent single line in the Daqarta spectrum. The new spectrum would show the higher peak line, but it would also show lower surrounding lines leading to the same average value.
Further, note that the default view of the spectrum doesn't have enough pixels to show increased frequency resolution; you must eXpand the spectrum for that. The eXpanded view will show the peak location with as much resolution as the expansion allows.
For example, at a sample rate of 48000 Hz the default view shows 512 spectral lines spaced every 46.875 hertz from 0 to just under 24000 Hz. If you set eXpand Max to 1500 Hz (1/16 of 24000) and leave eXpand Min at 0, the display frequency resolution will be 16 times higher. However, only the selected peak will take advantage of this; the rest of the display points will simply be spaced 16 times farther apart.
Only a single interpolated peak point is shown. This is simply connected to the flanking uninterpolated points with straight lines, with no attempt to interpolate any other intermediate points that would have been available if the original spectrum had been obtained via a proportionally larger FFT.
SpectPeak=1 sets Spectrum Cursor Peak mode, SpectPeak=0 turns it off, and SpectPeak=x toggles between on and off.
When Cursor Track is also active, Posn?F returns the tracked frequency, Posn?N returns the corresponding MIDI note number for Pitch Track operation, Posn?V returns the peak magnitude (scaled such that 2^30 is 100% of the full-scale range), and Posn?v returns the corresponding MIDI velocity.
Questions? Comments? Contact us!We respond to ALL inquiries, typically within 24 hrs.
Over 35 Years of Innovative Instrumentation
© Copyright 2007 - 2021 by Interstellar Research
All rights reserved