White noise between two frequencies

Hi,
how can I generate noise (white is the main one but also others) only between two frequencies that I can specify (instead of the default 20-20KHz)?

So that if looking at the spectrum it would be preferably either a square or a bell-shaped window/spread. Other shapes would be also acceptable but those are the preferred ones.

Thank you as always! :slight_smile:

Generate white noise, then apply a filter curve of your own design, (which could be square).

Thank you Trebor
but that would not produce a good result for relatively narrow band and also for low frequencies. If you look at the FFT afterwards is far from white noise. It has very frequencies, the lower you filter.

Any other suggestions?

Thank you

If you look at the FFT afterwards is far from white noise. It has very frequencies, the lower you filter.

The filtering is probably more accurate than the FFT. :wink:

The Classic Filter effect can make high-pass & low-pass filters which you can combine (one after the other) to make a bandpass filter, but you won’t get a bell shape.

That’s called “band limited noise” rather than “white noise”.

band-limited-noise.png

Thank you all,
how can I generate the “band limited noise” that Steve mentioned above?

Lets say I want noise (preferably white) between 20 and 100Hz, how do I do that so that I get as many frequencies in there as possible instead of only the 10-50 which are in that band if generated with the 20Hz to 20KHz solution and then band-pass filter it?

Thank you :slight_smile:

Whit noise is completely random* so over-time it includes ALL frequencies equally.


\

  • Digital noise (like all digital audio) is constrained to half the sample rate. And computers can’t (easily) generate true-random numbers but they can be “random enough” and unpredictable enough for audio, or gambling or almost any practical application where you need randomness.

What’s the application?

I get as many frequencies in there as possible instead of only the 10-50

As above, you may need to sample over time to make sure all your frequencies are represented.

We need to drag this back to the application. If you need to supply a sound file, there are significant problems depending on the type of file and the loudness of the work. For example, producing a plain, simple WAV sound file is going to include dithering tones, not just the desired work. MP3 files’ very existence depends on managed distortion.

Scientists get into trouble very rapidly with Audacity.

Audacity is a sound editor and if it’s a toss-up between strict scientific accuracy and sounding good, Audacity will always pop for sounding good.

Koz

  1. Generate white noise
  2. Use “Spectral Delete” to remove frequencies above the upper frequency limit.
  3. Use “Spectral Delete” to remove frequencies below the lower frequency limit.

Spectral delete: Spectral Delete - Audacity Manual

Thank you again :slight_smile:

Some things are still not clear. Could you please explain a bit more. BTW, the frequency band I want white noise in is 2Hz (if Audacity goes that low) all the way to 100Hz. Definitely nothing beyond that.

  1. If I use “Spectral Delete” from a Audacity-generated white noise - which I think goes up to 20KHz - it only shows the frequencies up to 8KHz (even in that help page link pictures) in the spectrogram. Why? And how do I remove those above the 8KHz?

Not sure what you mean sample over time… Sampling to me (in electronic) is digitizing a signal. So not sure what you mean exactly.
Do you mean to somehow cut and paste/overlap/mix parts of the same track from “later in the track” into an earlier part of the track and then use only the earlier (obviously long enough) part of the track?

Thank you

BTW, humans cannot hear below 20Hz, (and audio electronics / transducers may not be able to produce <20Hz).

Zoom out to see the whole spectrum.

You will have a hard job measuring that. How will you test for the presence of frequencies below 2 Hz ?
You can ensure that there is no “0 Hz” present. 0 Hz is called “DC Offset” and it can be removed using Audacity’s Normalization effect. See: DC offset - Audacity Manual

Even if you use state of the art scientific equipment, there will be a tiny amount of noise at all frequencies. For example, unless you are performing your experiments at temperatures close to absolute zero, there will be thermal noise.

Perhaps you don’t really mean “nothing” (as that is impossible). Perhaps you mean “nothing significant”, but even with unfiltered white noise there’s very little energy below 2 Hz.

There is no such thing in the real world as an “ideal filter”. All filters have a filter slope. In the case of the “Spectral Delete” effect, the filter slope is exceptionally steep and has low ripple - it is “close” to an “ideal filter”, but ideal filters are not even theoretically possible.

More information here: Sinc filter - Wikipedia

In the image that I posted, the track spectrogram view shows (approximately) 0 to 700 Hz. The display is configurable. See here for details: Spectrogram View - Audacity Manual

Is there a practical purpose for this?

Just that the rules may change a bit at both ends of the spectrum.

You can time 2Hz with a stopwatch, pencil, and paper. You can’t just swoop in with quick frequency analysis and announce that there’s no 2Hz in your work. 2Hz hasn’t even gotten out of bed yet and had its coffee.

Particularly with “white noise” which, by definition is random all frequencies. You’re not analyzing the presence of 2Hz, you’re analyzing the chance of having detectable 2Hz content in your custom mix.

Like showing up at the beach with a ruler and going home a half-hour later confident that the ocean doesn’t have tides.

It doesn’t work like that.

Select a good long chunk of your content and then use Analyze > Plot Spectrum at a very high “Size:” value. You can pull the window sideways to the width of your screen to magnify the values.

Screen Shot 2021-06-23 at 4.35.49 PM.png
I know what 2Hz is. I’ve been through those.

Screen Shot 2021-06-23 at 4.38.57 PM.png
Is this your area of investigation?

Koz

Maybe you should tell us what you’re trying to accomplish…

the frequency band I want white noise in is 2Hz (if Audacity goes that low) all the way to 100Hz. Definitely nothing beyond that.

Theoretically it goes to zero Hz but there are some “complications”.

Since it’s random the probability of it being exactly zero Hz or exactly 2Hz (at any moment) is essentially zero. The probability of it being between 0 and 2Hz is also very-very low… It’s the the same as the probability of it being between 100 and 102Hz.

The probability of it being between zero and 100Hz is also pretty low so if you high-pass at 100Hz you’re throwing-away most of the information and you’ll have a low-level signal that will need to be amplified after filtering.

On top of that, frequency is cycles-per-second so it takes some time to define frequency. But white noise is changing moment-to-moment so the whole concept of “frequency” isn’t that meaningful, except we can filter/constrain to a range of frequencies.



BTW - FFT gets tricky at low frequencies because it puts the frequencies into “bins” (frequency bands). (That’s in addition to some other FFT “issues” that I don’t fully understand.) The frequency scale is usually displayed logarithmically but behind the scenes it’s linear. For example, if the bins are 10Hz apart you have one bin from 0-10Hz and a bin from 1000 to 1010 Hz, etc. On the logarithmic scale and to the ear you get better resolution in the higher frequencies.

But if you have filtered to below 100Hz you can Amplify and then zoom-in and sort-of “see the frequencies” and you can measure the time between waveforms (or between zero crossings) to calculate the frequencies.


P.S.
I just tried a 2Hz low-pass filter and then amplified. I did get a nice random-looking waveform! There is information at and below 2Hz,

Pretty close, complicated to make, and totally silent on my laptop speakers :smiley:

Here’s the audio file:

Screenshot.png

Thank you all once again, very useful and much appreciated feedback!! :slight_smile:

@Steve,
That is as close as I think is achievable to what I am looking for. But I need to be able to change the frequency band from experiment to experiment (see below).
how did you get that output? I tried your original suggestion and don’t get that nice spectrum you show in your latest picture if I try the low frequencies. Did you do something else?

@Koz and @DVDdoug,
The “what/why”… what I am trying to do is to compare various brainwave response/entrainment based on audio/visual stimulus. That is the reason why it needs to be very low. Yes the lowest I am interested is 1-2Hz (although down to 0.5 would be even better), definitely NOT DC (i.e. 0Hz) because there is no response there but very low frequencies are picked up both visually and auditory. The visual is obvious. And the auditory is done not by playing the sub 20Hz but through binural beats and/or various other techniques. Years ago I use to have a great program called Neuroprogrammer but the company is not around anymore and cannot find any similar ones.

The “goal” is to develop a adapting system for relaxation based on various papers and research I came across through the years. Different from the classic binural beats you find everywhere. But need to do various experimenting to see how effective the solution I have is.

Thank you all again :slight_smile:

Yes the lowest I am interested is 1-2Hz (although down to 0.5 would be even better),

You can high-pass at 0.5Hz, low-pass at 2Hz, then Amplify. That works.

Note that the filter cut-off frequency is always defined as -3dB no matter how sharp the filter. So you might want to go slightly lower and slightly-higher.

In this application and with such a narrow bandwidth it might be better to generate a randomly fluctuating (or randomly “warbling”) frequency, rather than filtering noise. You could do that with [u]Nyquist[/u] but you’d have to learn some Nyquist programming. That way you could more-tightly control the frequencies and independently control the rate of “warble”. I’ve never used Nyquist myself but it should be a relatively simple thing to program.

To get that nice spectrum, you need to use a very high “Size” (FFT size) setting in Plot Spectrum.
If you analyze the “low-noise.flac” file that I posted with Plot Spectrum, and use the same setting in Plot Spectrum as shown in the screenshot, you should see a very similar spectrum.

To generate that noise:

  1. Create a mono audio track (from “Tracks menu > Add New”)
  2. Set the track sample rate to 2 x the required upper frequency limit (How to set the track “rate”: Audio Track Dropdown Menu - Audacity Manual)
  3. Generate white noise into the track
  4. Use “Filter Curve EQ” to filter out frequencies below the lower bound. (two screenshots to show the filter curve that I used are below).
  5. Resample the track to a usable sample rate. I resampled to 22050.
  6. Normalize to 0 dB with DC offset correction enabled.
  7. Apply an “s-curve” fade in and fade out to avoid broadband noise at the start / end.
  8. Export in a lossless format. I used FLAC format, but WAV would also be OK.



Thank you Steve and DVDdoug! :slight_smile:

@Steve, thank you for the detailed steps, it works very well!! :slight_smile: