如题,设计了一个滤波器,想过滤后进行傅里叶变换,但是参数怎么设定?看了一下这个函数是没有参数的?
function Hd = daitong
%DAITONG Returns a discrete-time filter object.
% MATLAB Code
% Generated by MATLAB(R) 9.3 and Signal Processing Toolbox 7.5.
% Generated on: 11-Jan-2023 10:52:00
% FIR Window Bandpass filter designed using the FIR1 function.
% All frequency values are in Hz.
Fs = 2000; % Sampling Frequency
N = 250; % Order
Fc1 = 130; % First Cutoff Frequency
Fc2 = 180; % Second Cutoff Frequency
flag = 'scale'; % Sampling Flag
% Create the window vector for the design algorithm.
win = hamming(N+1);
% Calculate the coefficients using the FIR1 function.
b = fir1(N, [Fc1 Fc2]/(Fs/2), 'bandpass', win, flag);
Hd = dfilt.dffir(b);
% [EOF]
ppgwatch=evalin('base','ppgwatch');
y=ppgwatch(:,2);
Fs=10;
T=1/Fs;
N=height(y);
t=(0:1:N-1)*T;
t=t';
y = table2array(ppgwatch(:, 2));
Y = fft(y);
Y=Y(1:N/2+1);
A=abs(Y);
f=(0:1:N/2)*Fs/N;
f=f';
plot(f,A);
set(gca,'XTick',0.0017:5);
set(gca,'YTick',0:0.5:3.5e+03);
axis([0 5 0 3.5e+03]);
xlabel=('hz');
ylabel=('幅值');