Data AcQuisition And Real-Time Analysis
Scope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
The following is from the Daqarta Help system:



Spectrum Analyzer

Signal Generator

(Absolutely FREE!)


Pitch Tracker


DaqMusiq Generator
(Free Music... Forever!)

Engine Simulator

LCR Meter

Remote Operation

DC Measurements

True RMS Voltmeter

Sound Level Meter

Frequency Counter
    Spectral Event

    MHz Frequencies

Data Logger

Waveform Averager


Post-Stimulus Time
Histogram (PSTH)

THD Meter

IMD Meter

Precision Phase Meter

Pulse Meter

Macro System

Multi-Trace Arrays

Trigger Controls


Spectral Peak Track

Spectrum Limit Testing

Direct-to-Disk Recording



Frequency response

Distortion measurement

Speech and music

Microphone calibration

Loudspeaker test

Auditory phenomena

Musical instrument tuning

Animal sound

Evoked potentials

Rotating machinery


Product test

Contact us about
your application!

Sound Card Power Spectral Density (PSD) Toggle

Controls: Spectrum Dialog >> PSD
Macro: PSD

You can toggle Power Spectral Density mode from the PSD button in the Spectrum dialog, or directly via ALT+SHIFT+P even when the dialog is not visible.

PSD only applies to Y-log (power spectrum) mode. The PSD mode simply scales the Y-log display by the frequency resolution to give power per Hz instead of just power. Since this just results in a vertical shift in the log display, why would we want to bother? The reason is that this makes it possible to compare results taken with different sample rates.

PSD is only useful (and valid) for continuous spectra like noise sources, where there is energy at every frequency. Each spectral line represents a narrow band of frequencies, and its value is the composite of all of those. Clearly, if we combined two or more adjacent bands together, the power in the new band should be the total of the individual powers. (Note that this does not hold true with magnitudes, since power is related to the square of magnitude.)

A spectrum obtained from 1024 samples at 22050 samples/second has bands that are 22050 / 1024 = 21.5 Hz wide. At 44100 samples/second they are 43 Hz wide. With a broadband noise source, the wider spectral bands have more total power per band, so the ordinary Y-log power spectrum would appear to show more total power.

Of course, there isn't really any more total power, since there are fewer bands in any given frequency region, but if you were trying to compare these two spectra it would not be at all obvious that they were actually recorded from the same source.

The PSD mode simplifies this by showing the results as if each band was exactly 1 Hz wide, so no matter how the original spectrum was taken the results are comparable.

To see the benefits of PSD mode for yourself, you need to look at a broadband noise source. A good one is usually the Mic input of your sound card, with no microphone connected. You'll be looking at the noise generated by the internal mic preamp, without any distracting sound input.

If you are using a laptop with a built-in microphone, you can usually disable it by plugging in an external mic. Just plug in a "dummy" mic instead, which can be a short extension cable that isn't connected to anything. No spare cables? Try plugging in a pair of headphones; they'll act like a fairly insensitive microphone, so you should try to be as quiet as you can during the test.

Run the Input sensitivity to maximum (0 step or dB on both the Mic and Master Input controls) and set the Spectrum Averager for 100 frames or more. Collect an average with a sample rate of 44100 kHz, and read the value at about 5 kHz. (The frequency isn't critical. You just want to be in the flat central portion of the spectrum.) With that average still showing, toggle PSD active and the spectrum drops by 16.34 dB. That's a power drop of 1/43, to convert the 43 Hz bandwidth to 1 Hz.

Set the sample rate to 22050 Hz and repeat the above. You should find that without PSD active, the value at the cursor appears to drop by about 3 dB, since the spectral lines represent bands that are half as wide. But with PSD active, the value only drops by 13.33 dB and should be comparable to that measured at the 44100 Hz rate.

You may be tempted to try this experiment without using a "real" noise source. After all, the Daqarta Generator has some dandy noise sources available. Why not just use the White noise option, for example? The problem with this is that Daqarta creates the noise as a series of random values. If you change the sample rate, the creation process is still the same, the samples just come out at a different rate. The spectrum is created by taking the FFT of 1024 of those samples; whether they come in fast or slow, they give similar mathematical results. So you don't see the noise power drop with decreasing sample rate like you do with real-world noise. The PSD option blindly applies the same 1 Hz bandwidth correction, however, so at higher sample rates the PSD appears to decrease.

Also, because the PSD correction is applied to all frequencies, it can give misleading results on a real-world spectrum if there are strong tonal peaks. To understand why PSD is not valid in such cases, consider that a pure sine wave has all its power in an "infinitely" narrow band in the first place. If an FFT filter band is tuned exactly to this frequency, the sine wave should be captured completely. Making that filter wider wouldn't allow "more" of the wave through, since there isn't any more... all we could do would be to let through other adjacent frequencies.

But what if you have an input that contains both broadband noise and strong tonal peaks? In that case you will need to use different methods to measure the different portions of the spectrum. Toggle PSD on when you are measuring the broadband portions, and toggle it off when you are measuring the tonal peaks.

Furthermore, an unwindowed spectrum of a pure tone will typically show significant energy in leakage skirts, which can spill over into the broadband portions of the spectrum. If the tones are the result of a stimulus that Daqarta is generating, you may be able to eliminate the leakage simply by using the Lines mode in setting the frequencies.

However, in the more usual case you will need to use a window function to reduce the leakage. The problem here is that window functions effectively widen the individual FFT filters. When you look at a broadband source, each spectral line sees this as additional energy leaking into it from its neighbors, giving a reading that is too high. In this case you must use Window Bandwidth Correction (BW Corr) to get a proper reading from the broadband portions of the spectrum, whether you are using PSD or not.

Macro Notes:

PSD=1 activates PSD mode, PSD=0 turns it off, and PSD=x toggles between on and off.

Note that PSD only takes effect in Y-log Spectrum mode.

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 - 2023 by Interstellar Research
All rights reserved