Need to generate bandpass filtered white-noise
6 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
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 件)
参考
カテゴリ
Help Center および File Exchange で Audio I/O and Waveform Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!