Need to generate bandpass filtered white-noise

6 Ansichten (letzte 30 Tage)
Abhilash
Abhilash am 27 Okt. 2011
Hi guys,
I am doing a psychophysical experiment and I need to generate two white noises, but which are bandpass filtered, the band of one shifted slightly higher than the other, so that the subjects can recognise the two sounds. The length needs to be 3s, fs of 44100 Hz.
I can generate the noise easily with the wgn function, but I am unable to bandpass filter it. Can someone please help me out?
Thanks

Akzeptierte Antwort

Honglei Chen
Honglei Chen am 27 Okt. 2011
You will need to determine the spec of your filter and then create the filter. It looks like you are dealing with audios so I'll just use 20-20k Hz as an example. You can generate the filter like this.
fs = 44100;
hf = design(fdesign.bandpass('N,F3dB1,F3dB2',10,20,20e3,fs));
This creates a bandpass filter with pass band between 20 Hz and 20 kHz. You may or may not want this configuration so you may want to take a look at the help
doc fdesign.bandpass
Once you get the filter, assuming x is what you get from wgn, which is white noise, you can simply get the filtered noise by
y = filter(hf,x)
HTH

Weitere Antworten (1)

Daniel Shub
Daniel Shub am 27 Okt. 2011

Kategorien

Mehr zu Audio I/O and Waveform Generation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by