フィルターのクリア

How to make narrow band noise

40 ビュー (過去 30 日間)
Freya Guo
Freya Guo 2021 年 12 月 9 日
コメント済み: Chunru 2022 年 8 月 30 日
Hi, I'm trying to make a noise with a central frequency of 2000Hz and a range of 0.25 oct. The specific parameters are:
cf1 = 2000; % central fq
bw = 0.25; % bandwidth in octave
low_f1 = cf1 / 2 ^ (bw/2); % lower limit of the fq range
high_f1 = cf1 * 2 ^ (bw/2); % upper limit of the fq range
So how do I make a noise for 0.6s long in matlab that ranges from the lower to the upper frequency range with 2000Hz as the centre? Thank you!!

採用された回答

Chunru
Chunru 2021 年 12 月 10 日
cf1 = 2000; % central fq
bw = 0.25; % bandwidth in octave
low_f1 = cf1 / 2 ^ (bw/2); % lower limit of the fq range
high_f1 = cf1 * 2 ^ (bw/2); % upper limit of the fq range
fs = 8000; % sampling frequency
% geberate a gaussian white signal
n = round(0.6*fs); % number of samples
x = randn(n ,1);
% band pass the white noise to get the narrow band
y = bandpass(x, [low_f1 high_f1],fs);
[p, f] = pwelch(y, 1024, 768, 1024, fs);
plot(f, 10*log10(p))
  5 件のコメント
Ankita More
Ankita More 2022 年 8 月 30 日
Hi I ran this code, I got the graph however stimuli could not be heard
Chunru
Chunru 2022 年 8 月 30 日
soundsc(y, fs) % to normalize the volum

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMeasurements and Spatial Audio についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by