Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
Spectrum Window Width
Window Width Button:
The Width button defaults to "Width 1024" which means the window function is applied to all of the data used to create the spectrum. In general, you should just leave it at this value. Repeated button clicks toggle to 512, 256, and 128 data points (with the button shown depressed), before returning to 1024 with the button shown undepressed.
By default, the window function is centered over the 1024 data points used for the FFT that creates the spectrum display. (That's indicated by the small button to the right showing 'o', as discussed below under Window Offset Button.) If you set Width 512, for example, the first and last 256 points are padded with zeros and only the center 512 data points receive the narrower window function. This effectively reduces the FFT from 1024 to 512 points.
As the effective FFT width is reduced, spectral resolution is reduced in proportion. However, temporal resolution is increased by the same proportion. (See Fundamental Time - Frequency Domain Concepts.)
This is of no value when viewing ordinary spectra, since there is no time axis to allow any such measurements. Spectrograms, however, do allow you to see the timing of spectral events. Yet even here the use of narrow widths has limited utility with live data. (Try it and see; make sure that Trigger is off, so you get maximum throughput.)
The place where the Width control is useful is when reviewing DDisk file data. There you can set the DDisk Read Step Size to small values so that, with Trigger off or in Pause mode, each 1024-point analysis data set moves only a small amount in time. (That is, each set overlaps much of the prior set.) This gives much higher temporal resolution than the case where each 1024-point data set comes after the previous one. Often, this small step size is all you need.
But sometimes you need still better temporal resolution and are willing to give up some spectral resolution to get it. This is the situation that the Width control was designed for.
A good example of where this is useful is with speech sounds. With a small Read Step and Width set at the default of 1024 points, you can easily resolve the harmonics of a vowel as a stack of horizontal lines. By toggling to smaller Width values like 256 or even 128 you can no longer resolve the individual harmonic frequencies, but you can easily resolve glottal pulses as a series of vertical lines. These are the bursts of sound energy from the vocal cords slapping together at the speaker's fundamental frequency (around 100 pulses per second for men), which excite the formant resonances of the vocal tract.
See Spectrogram (Voiceprint) Screen Images for examples of the above.
Window Offset Button:
Just to the right of the Width button is a small button that defaults to 'o'. This indicates that the window is centered within the 1024 data points used for the spectrum display. Clicking the button once changes it to '<', which means that the window has been offset to begin at the start of the 1024 samples. A second click changes to '>', meaning that the window is at the end of the 1024 samples. A third click returns to 'o'.
These left and right offsets only have an effect when Width is less than 1024. They normally have limited use, but the left offset is very important for use with the DaquinOscope macro mini-app when it is displaying spectra of 2 or 4 analog channels.
Due to the limited data memory on the Arduino Uno board used by the scope, only 1024 total data values can be obtained for a single display frame. 2-channel mode can thus store only 512 time points (each a pair of samples), and 4-channel mode only 256. Daqarta sorts this data into individual 1024-sample buffers for each channel, each buffer receiving data in only the first 512 or 256 positions, with the remainder of the buffer filled with nulls.
In waveform display mode, DaquinOscope deals with this by setting X-Axis eXpand to show only the first 512 or 256 samples of each channel. But Spectrum mode always uses a full 1024 samples to compute the FFT for display, which would result in less overall energy reported at every frequency due to the last half or 3/4 of the data being nulls.
To see a better representation of the spectrum, you must not only make sure Spectrum Window is active, with Width set to the appropriate 512 or 256 setting, but you must also set the offset to '<' to align the window position with the data.
Window Width and Peak Operation:
The Spectrum Cursor Peak mode, alone or as part of Track, has been calibrated assuming the full 1024-sample width for each of the included window functions. If you use Width 512, 256, or 128 the cursor readout will report values that are too high when used with most window types. The error amount depends not only on the window type, but also on how far the true frequency is from the nearest spectral line.
The error is larger for smaller widths. Typical worst-case errors (1009 Hz tone at 48000 Hz sample rate):
SpectWidth=512 sets Spectrum Window Width to 512. The value you supply will be rounded to one of the following available widths: 1024 (default), 512, 256, or 128.
SpectWidth=x advances to the next Width value just like a manual button click: 1024, 512, 256, 128, 1024...
SpectWindOfs=0 sets the window offset to the 'o' default center position. 1 is the '<' left position, and 2 is the '>' right position.
See also Spectrum Control Dialog
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