firbfilt.m

来自「使用Matlab实现了FIR与IIR滤波器」· M 代码 · 共 32 行

M
32
字号
function [ output_args ] = Untitled1( input_args )%UNTITLED1 Summary of this function goes here%  Detailed explanation goes here[y,ft,bits]=wavread('hello.wav');subplot(2,2,1);plot(y);xlabel('Time Index t');ylabel('Amplitude');title('原始时域图象');grid;subplot(2,2,2);plot(abs(fft(y)));xlabel('Frequence Index w');ylabel('Amplitude');title('原始频域图象');grid;fcutsb=[1000 1200 3000 3200];magsb = [0 1 0];devsb = [10^(-100/20),(1-10^(-1/20)),10^(-100/20)];[Nb,Wnb,betab,ftypeb] = kaiserord(fcutsb,magsb,devsb,ft);kwb = kaiser(Nb+1,betab);bb = fir1(Nb,Wnb,kwb);vb=fftfilt(bb,y);subplot(2,2,3);plot(vb);xlabel('Time Index t');ylabel('Amplitude');title('FIR带通滤波时域图象');grid;subplot(2,2,4);plot(abs(fft(vb)));xlabel('Frequence Index w');ylabel('Amplitude');title('带通滤波后频域图象');grid;sound(vb,ft,bits);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?