필터 지우기
필터 지우기

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 CenterFile Exchange에서 2-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