Daqarta
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:

Features:

Oscilloscope

Spectrum Analyzer

8-Channel
Signal Generator

(Absolutely FREE!)

Spectrogram

Pitch Tracker

Pitch-to-MIDI

DaqMusiq Generator
(Free Music... Forever!)

Engine Simulator

LCR Meter

Remote Operation

DC Measurements

True RMS Voltmeter

Sound Level Meter

Frequency Counter
    Period
    Event
    Spectral Event

    Temperature
    Pressure
    MHz Frequencies

Data Logger

Waveform Averager

Histogram

Post-Stimulus Time
Histogram (PSTH)

THD Meter

IMD Meter

Precision Phase Meter

Pulse Meter

Macro System

Multi-Trace Arrays

Trigger Controls

Auto-Calibration

Spectral Peak Track

Spectrum Limit Testing

Direct-to-Disk Recording

Accessibility

Applications:

Frequency response

Distortion measurement

Speech and music

Microphone calibration

Loudspeaker test

Auditory phenomena

Musical instrument tuning

Animal sound

Evoked potentials

Rotating machinery

Automotive

Product test

Contact us about
your application!

Noise Band Shape - Taps

Controls: Gen Dlg >> Stream >> Wave >> Band >> Band Shape - Taps
Macro: BandTaps

Introduction:

The Noise Band Shape - Taps control is a drop-down list which shows the current selection. Click the small arrow at the right end, and the list of options appears below the control. Click on an item to make it the current selection. The options are:

    Curve0 - Norm All
    Curve1 - Norm All
    Curve2 - Norm All
    Curve3 - Norm All
    Curve0 - Norm Band
    Curve1 - Norm Band
    Curve2 - Norm Band
    Curve3 - Norm Band
    Flat - 512 Taps
    Flat - 256 Taps
    Flat - 128 Taps
    Flat - 64 Taps
    Flat - 32 Taps
    Flat - 16 Taps
    Flat - 8 Taps

The CurveN selections are for Equalized Noise Bands... see that subtopic, below. The others are for Flat-Topped Noise Bands.

The higher the number of Taps, the steeper the edges of the selected band. (If you are running on an older system, note that a higher value uses more memory and takes more CPU time for the noise generation. Equalized bands all use 512 taps, but consume no more resources than 512-tap flat bands.)


Theory:

The noise band (or gap... see Noise Band Rise and Fall Edge Frequencies) is generated by filtering a wideband white noise source, using what is known as a Finite Impulse Response (FIR) filter. Conceptually, this consists of a delay line that the input noise passes through; each stage of delay is one sample period in duration, and after each there is a "tap" to monitor the noise at that stage. (If you think of the system as water flowing through a long pipe, consider that the taps are only pressure monitors... they don't actually "tap off" any of the flow.)

The signal at each of these taps is still white noise, just delayed differently from the other taps. To see how this might be used to make a filter, consider what happens if we add two tap signals together: For some frequency of the input (which is white noise containing all frequencies), the delay between the two taps will be exactly the duration of one whole cycle at that particular frequency. At that frequency (and multiples thereof), the two signals will be "in phase" and the amplitude of that component will be doubled in the sum. But at some other particular frequency (and multiples thereof), the delay will be only a half cycle, such that it will be added with a sign change; those frequencies in the signal will be cancelled.

The net effect of adding two taps is called "comb-filtered" noise, with alternating peaks and dips whose spacing is determined by the relative delay. (See Comb Filtering and "Flanger" Effects for further discussion.) To get a more useful filter, additional taps can be added, and each tap signal can also be multiplied by some weighting constant before being added into the final output.

Imagine starting with the multiple peaks and dips of the simple 2-tap comb filter, then selecting additional taps and constants such that some peaks are boosted further, and some are cancelled. The more taps you have to work with, the more peaks can be boosted or cancelled. By proper selection of tap constants, an arbitrary filter shape can be created. Using still more taps will always allow a better filter.

Since each tap requires a multiplication by its constant, and all the taps must be added to get each output sample, this process can be quite slow. To avoid multiplying, which is a relatively slow CPU operation, Daqarta uses a trick: Instead of using ordinary white noise, which is a stream of random values, it uses binary noise which randomly switches between only two states.

To understand this, first note that binary noise is still white noise, which means that all frequencies are equally present. You can verify this by looking at the spectrum of the White source and changing the Timing Quant value from 0 (no quantization) to 1 (binary). There is a slight increase in level because the output spends more time at the full-scale limits, but the spectrum remains flat. (Alternatively, you could leave Timing Quant at 0 and set Generator Bits from 16 down to 1. In that case, the two output states are 0 and -100% so the sound is softer, but otherwise the same.) In listening tests, the binary and ordinary White noise sound absolutely identical except for the overall level difference.

Now consider that binary noise is nothing but a string of 1s and 0s (or +1s and -1s). Multiplication by a constant thus turns out to be merely adding or subtracting, depending on the data value; this is much faster than a true multiplication. Daqarta further improves on this concept by building look-up tables containing the summed output for strings of bits, so the final output can be found very quickly via a few table look-ups. (Whenever you change any Band parameter, a whole new set of look-up tables is built.)

So, how does all this affect actual use of the Band source? For the vast majority of applications it has no effect at all. Use of binary noise only affects the amplitude distribution of the values, not the spectrum. Since our ears don't hear amplitude distributions, this has no effect on listening tests. See Comparing Noise Distributions in the Auditory Phenomena and Experiments section for a demonstration that compares binary and Gaussian noise, as well as uniform White and Gaussian. You can use this same approach to compare any two distributions that have the same spectrum.

What's more, even with binary noise as the input, the output of the FIR filter is not in general binary... after all, each output value is the sum of many taps, each of which has been scaled by a different constant to some non-binary value. So in most respects the final output, including its waveform and amplitude distribution, is indistinguishable from a noise band produced by any other method.

However, since the Band source is fully adjustable, it is possible to set it to have very little filtering action. Clearly, if you set Rise Fc to 0 and Fall Fc to maximum, the essentially unfiltered noise will show a binary appearance in its waveform. As you reduce Fall this appearance is less and less apparent, and is essentially gone by the time Fall is half of maximum (ie. half of Nyquist). The binary appearance is most noticeable with low-pass noise; with high-pass or band-pass it is much less visible.

You may also see a binary appearance with gap noise, when you set a narrow gap near the top of the range.

Since this binary appearance is inaudible, the main issue is whether there is some other effect it might have. If you are using the Band output to modulate some other source via the Stream Modulation option, for example, then the distribution of the values might make a difference. You might want to add a small amount of Smoothing to reduce this, although it will cause the spectrum to tilt downward.

(Note that in general you should not use Slow or Step Timing with the Band source. If you do, you will get a series of decreasing "images" in the spectrum. These are copies of the desired band that appear due to aliasing, since you have effectively reduced the sample rate.)


Flat-Topped Noise Bands:

When Band Shape is set to Flat - 8 Taps to Flat - 512 Taps (not one of the Curve selections), the generated noise band spectrum has the flattest top consistent with the specified number of taps. (Since the output is, of course, still noise, the best way to see the flatness is using Spectrum Averaging; even an average of just 32 frames is very useful, and you can use Exponential mode for continuous averaging as you examine the effects of various settings.)

At 512 taps the top is very flat, with sharp shoulders and steep cutoffs. With the Noise Band Window set to the default Hann window, the floor falls to around -125 dB... about 90 dB below the band top. (The band top is at about -35 dB relative to full scale, since headroom must be allowed to prevent clipping on infrequent peaks.)

If Window is set to Rectangular, no window function is used. The cutoffs start out steep, but then become gentle slopes farther from the cutoff. Each slope is really a series of decreasing peaks or sidelobes, though individual peaks may be hard to notice with 512 taps.

If you reduce the taps setting, the sidelobes become more prominent: less frequent but wider and taller. The passband shoulders become more rounded, and with very low taps there may no longer be any flat portion of the passband.


Equalized Noise Bands:

When Band Shape is set any of the CurveN options, the flat-topped passband is replaced with a section of the specified Spectrum Weighting Curve. The curve is normalized such that the highest peak of the curve is about -35 dB relative to full scale, to prevent clipping on infrequent noise peaks... just like the flat portion of a Flat band. (See Curve Normalization, below, for the difference between Norm All and Norm Band options.)

Equalization allows you to create flat-topped acoustic noise bands, even with a sound system that doesn't have a flat frequency response. To do that, you need a Mirror Curve File that compensates the system response.

Using a calibrated microphone (with its .CAL or .FRD file loaded into the Load Mic Cal File section of the relevant input User Line in the User Units Dialog), obtain a frequency response of the sound system. The simplest way to do that is to set the Generator to White Noise driving the sound system, and view the Input from the microphone. Make sure Spectrum is on, and set the Averager controls to Linear with 1024 Frames. Toggle the Averager on and wait for it to complete (several seconds). When it automatically Pauses at the end of the average, save the response spectrum as a .CRV file. This file will have peaks that exactly compensate dips in the sound spectrum, and vice-versa.

Then go to the Spectrum Curves dialog and load it as one of the Weighting Curve Files. Important: Do not select any of the channel buttons under this file, which would apply the curve to the display... here we want to apply it only to the generated noise. Now in the Noise Band dialog select the relevant Curve in Band Shape - Taps.

Alternatively, you may prefer to use Pink Noise to obtain the original frequency response from which the Mirror curve is derived. Pink noise has a spectrum closer to that of music: higher output at low frequencies, falling at -3 dB per octave as frequency rises. But of course then the spectrum you obtain would tilt downward at -3 dB per octave as well, in addition to whatever response variations are caused by the sound system. To compensate, go to the Spectrum Curves dialog and enter '3.01' for the Left Input channel (assuming that's what you are using) in the Tilt, +/-dB / Octave section at the bottom. Then make that Tilt active by clicking on the Left Input button below that.

This will flatten out the displayed spectrum, as if it had been created from from a White source, but leave the response variations due to the sound system. Those will be compensated when saving the .CRV file. Important: Be sure to toggle the Tilt off afterward.


Curve Normalization:

Wherever your sound system has a response dip, the Mirror curve will have a compensating peak. But to prevent clipping on noise peaks, the output at any frequency must be limited to about -35 dB relative to full scale. Thus, to get a flat acoustic response, the overall noise band must be reduced such that the highest peak does not clip.

Daqarta does this by normalizing the raw curve data prior to generating the FIR filter. It first scans for the highest dB peak in the curve, then subtracts that from the other dB values. That causes the peak output to be the non-clip limit, with the response at all other frequencies proportionally below that.

Usually, you should select one of the CurveN - Norm Band options, so that only peaks within the frequency region of the noise band are considered. That's because real-world sound systems may have big response dips, and usually have steep roll-offs at both ends of the design range. If you want to generate a band of noise between (say) 1 kHz and 2 kHz, you only need to compensate for peaks and dips within that range; outside that range the output will be minimized anyway. You probably wouldn't want the desired noise output level to be needlessly restricted due to a huge peak in the Mirror curve caused by sharp speaker roll-offs above 20 kHz and below 40 Hz, for example, which are outside the range of interest.

However, suppose your experiment involves comparisons between bands of noise that have the same width in Hz, but different frequencies. You'll need to keep the levels of each band the same for a valid comparison. Even if you are comparing different bandwidths, such as octaves (whose absolute width is proportional to frequency), you'll need a known reference standard for the level.

If you used the CurveN - Norm Band option and there was a big dip in the sound system response that fell in only one of the bands (causing a big peak in that part of the Mirror curve), that band would have a lower level than the other bands.

The CurveN - Norm All option can resolve this by using the same lower level for all bands. The normalization scans the entire curve and insures that the highest peak (deepest dip in the raw system response) will not exceed the clipping limit. Since the same peak will be used as the reference no matter what band limits you use, they will all have the same reference level.

Note, however, that this shouldn't be applied blindly; since you will typically be testing at frequencies within the specified response range of the sound system, you want the normalization to avoid frequencies outside that range, where there may be little output and thus a big Mirror peak that would needlessly reduce all levels.

The best way to handle this is to create a special version of the Mirror curve file. Copy the original whole-system file and give it a distinctive name. Open the copy in any text editor (Windows Notepad is fine) and decide what frequencies you want to exclude. Then change their dB values to -200 (arbitrary) to insure they will never be chosen as the peak.

If you want to exclude a large range of frequencies, you don't need to edit each one separately. For example, to exclude 12 kHz and above you just set the 12000 Hz dB value to -200, then delete everything above that except the highest frequency (which you can set arbitrarily high), which you would also set to -200. Since Daqarta interpolates the file data to get the actual curve values it uses, everything in between will also be -200.


Arbitrary-Spectrum Noise:

The methods discussed above to create equalized noise bands can also be used to create noise of any arbitrary spectral shape. The selected Curve holds the desired shape, plus any needed equalization to compensate for the system frequency response.

Assuming you already have a Mirror curve of the system response, you can use any text editor (like Windows Notepad) to create a custom Weighting Curve File having the desired final shape. Then load these as Curve0 and Curve1 in the Spectrum Curves Dialog, and run the Curve_Sum macro that is included with Daqarta. That will sum the two curves together and save it as CurveSum.CRV (or any other name you select) in Daqarta's App_Data folder with all the other curves. You may then unload Curve0 and Curve1 and load the CurveSum file.

Now select that curve number in Band Shape - Taps. You will usually want to select the 'Norm Bands' version and set Rise and Fall frequencies to exclude the upper and lower extremes where your system response falls off drastically.

Other than avoiding those extremes (which would cause the overall output level to be reduced in order to achieve the desired spectrum without clipping), there is no reason to limit the noise to a discrete band. For example, the Pink noise source produces broadband electrically pink noise. You typically use this to test sound systems, since it has the approximate energy distribution of music. This is not only what our ears expect, but what speaker systems are designed for. Pink noise puts more energy into low frequencies where human ears are less sensitive and the sound system uses large high-power 'woofer' drivers. If that same level was applied at high frequencies, it would not only sound very harsh, but it could damage the small low-power 'tweeter' drivers.

Typically, you apply this electrically-pink noise to the system and measure its response using a +3 dB / Octave Tilt so that the screen shows a (nearly) flat line if your system has a perfectly flat frequency response. (See Pink Noise Response under Frequency Response Measurement for details.) You can then adjust whatever equalization controls your sound system provides to get the response as flat as possible.

However, if you want to hear true acoustically pink noise despite any system response problems, you can use the summed-curves method to produce it from the measured system frequency response, plus a curve that holds the target Pink response. This is provided with Daqarta as Pink.CRV.

The acoustic result won't be "perfect", because in principle the output should rise 3 dB for every octave that the frequency is reduced... right down to "earthquake" levels at ultra-low frequencies. Sound cards, not to mention speakers (or ears) don't respond well at very low frequencies, so the response will typically only be "pink" down to about 40-50 Hz or so.

Just for fun, you can try creating noise sources whose spectrum matches a certain profile, such as a city skyline or a reclining figure or face. (Just make sure there are no "undercuts" in the target profile, such that the frequency would have to reverse direction instead of running from low to high.)


Macro Notes:

L.1.BandTaps=128 sets the Left Stream 1 Band Taps to 128. Valid settings are 0 to 7, 8, 16, 32, 64, 128, 256, and 512. Other values will be rounded to the nearest valid setting.

Settings of 8 to 512 select Flat - 8 Taps to Flat - 512 Taps.

Settings of 0 to 3 select Curve0 - Norm All to Curve3 - Norm All. Settings of 4 to 7 select Curve0 - Norm Band to Curve3 - Norm Band. These apply Spectrum Weighting Curve 0 to 3 to a 512-tap filter to obtain an equalized noise band, normalized to either the highest peak in the entire curve, or only in the designated band. If the specified curve number is not loaded, the result will be equivalent to a Flat - 512 Taps band.


See also Band-Limited Noise, Noise Waves, Wave Dialog.

GO:

Questions? Comments? Contact us!

We respond to ALL inquiries, typically within 24 hrs.
INTERSTELLAR RESEARCH:
Over 30 Years of Innovative Instrumentation
© Copyright 2007 - 2017 by Interstellar Research
All rights reserved