How to generate a noisy sound?

I want to generate a sound within the band of [33k Hz 35k Hz] for 8 second. The sound is used for hearing test, so I need a sound with mixed frequency within the range. How can I do that?
Thanks

 Accepted Answer

The upper limit of human hearing is about 20 kHz, so they won’t be able to hear the signal.
This will generate it:
Fs = 44100; % Sampling Frequency
NrFreqs = 5; % Number Of Frequencies To Use
LoFreq = 33E+3; % Low Frequency Limit
HiFreq = 35E+3; % High Frequency Limit
t = linspace(0, 8, Fs*8); % Time Vector
fv = linspace(LoFreq, HiFreq, NrFreqs); % Freqency Vector
tm = bsxfun(@times, t, fv'*2*pi); % Create Time Matrix
sm = sum(sin(tm)); % Create Signal Vector
sound(sm*100, Fs) % Listen To Result

4 Comments

The lower end of hearing is lower than was thought: http://www.sciencedaily.com/releases/2015/07/150710123506.htm
Notice (and this applies for the purpose of this Question) that in order to do the tests properly for research purposes, it is necessary to construct special equipment to ensure that the sound produced is completely free of harmonics.
There might be some difficulty in finding equipment that can reproduce sounds in the 33 KHz to 35 KHz range in a controlled way.
Thank you Walter. I wasn’t aware of the extended infrasound perception.
Your comment on the harmonics is well-taken, expecially because most soundcards and other electronics can only operate reliably up to 44.1 KHz, and that sampling frequency was intended to provide reliable, non-aliased reproduction of sound frequencies up to 20 KHz.
The sound testing is for rats, so the frequency is high. I'll increase the sampling rate to 88.2 KHz in case of alias. Thank you guys for your helps, the code works.
My pleasure.
I’m curious as to the driver circuitry and transducer you’re going to use for that. (My rat never listens to me!)

Sign in to comment.

More Answers (0)

Categories

Find more on Audio Processing Algorithm Design in Help Center and File Exchange

Asked:

on 19 Aug 2015

Commented:

on 21 Aug 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!