Need to generate bandpass filtered white-noise

6 ビュー (過去 30 日間)
Abhilash
Abhilash 2011 年 10 月 27 日
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

採用された回答

Honglei Chen
Honglei Chen 2011 年 10 月 27 日
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
  1 件のコメント
Abhilash
Abhilash 2011 年 10 月 27 日
Thanks, I'll just try this out.

サインインしてコメントする。

その他の回答 (1 件)

Daniel Shub
Daniel Shub 2011 年 10 月 27 日

カテゴリ

Help Center および File ExchangeAudio I/O and Waveform Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by