フィルターのクリア

I have the following code in Matlab, the problem is that it does not graph anything, nothing comes out of plot *does not show any error in the console

1 回表示 (過去 30 日間)
fc1=0.33;
fc2=0.83;
f=[fc1,fc2];
h=fir1(64,f,'stop');
[samplerate.data]=audioread("Domini_Fil.wav");
plot(data)
filteredData=filtfilt(h,1,data);
plot(filteredData);
[w,rh]=freq(h,1,64);
w_pi=(w/pi)*6;
plot(w_pi,abs(rh));
fft_input=fft(data);
fft_output=fft(filteredData);
plot(abs(fft_input));
plot(abs(fft_output));

回答 (2 件)

Cris LaPierre
Cris LaPierre 2022 年 12 月 19 日
編集済み: Cris LaPierre 2022 年 12 月 19 日
Attach your wav file to your question using the paperclip icon. It would also help to have your freq function code. Still, using a built-in wav file (bluewhale.wav), there doesn't appear to be anything wrong with your code. Perhaps your file does not have any data?
fc1=0.33;
fc2=0.83;
f=[fc1,fc2];
h=fir1(64,f,'stop');
[data]=audioread("bluewhale.wav");
plot(data)
filteredData=filtfilt(h,1,data);
plot(filteredData);
% [w,rh]=freq(h,1,64);
% w_pi=(w/pi)*6;
% plot(w_pi,abs(rh));
fft_input=fft(data);
fft_output=fft(filteredData);
plot(abs(fft_input));
plot(abs(fft_output));

Image Analyst
Image Analyst 2022 年 12 月 19 日
Try calling
hold on
after your first call to plot.
If you have any more questions, then attach your data ("Domini_Fil.wav") with the paperclip icon after you read this:
  2 件のコメント
Image Analyst
Image Analyst 2022 年 12 月 19 日
After the first call to plot, if you want them all on the same graph. Or use subplot if you want them in separate graphs.
fc1=0.33;
fc2=0.83;
f=[fc1,fc2];
h=fir1(64,f,'stop');
[samplerate.data]=audioread("Domini_Fil.wav");
plot(data)
hold on; % Prevent subsequent plots from blowing away earlier ones.
filteredData=filtfilt(h,1,data);
plot(filteredData);
[w,rh]=freq(h,1,64);
w_pi=(w/pi)*6;
plot(w_pi,abs(rh));
fft_input=fft(data);
fft_output=fft(filteredData);
plot(abs(fft_input));
plot(abs(fft_output));

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by