五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊

MATLAB設(shè)計(jì)帶通和帶阻巴特沃斯濾波器

2022-05-16 10:07 作者:e小白官方  | 我要投稿

e小白網(wǎng)址:www.e-xiaobai.com

%% 設(shè)計(jì)通帶為30HZ-60Hz的6階巴特沃斯帶通濾波器
% [filtered_signal,filtb,filta] = bandpass_butterworth(inputsignal,cutoff_freq,Fs,order)
% INPUTS:
% inputsignal = input time series
% cutoff_freqs = filter corner frequencies in the form [f1 f2]
% Fs = data sampling frequency
% order = order of Butterworth filter
% OUTPUTS: 
% filtered_signal = the filtered time series
% filtb, filta = filter numerator and denominator (optional)
clear;clc;
t=0:0.005:5;
T=0.005;%時(shí)間間隔
Fs=1/T;%采樣頻率
y1=5*sin(2*pi*10*t)+3*sin(2*pi*40*t)+6*sin(2*pi*80*t);
y2=3*sin(2*pi*40*t);
[filtered_signal,filtb,filta]=bandpass_butterworth(y1,[30 60],Fs,6);
figure(1)
subplot(3,1,1)
plot(t,y1)
title('原始信號(hào)')
subplot(3,1,2)
plot(t,filtered_signal)
title('濾波后信號(hào)')
subplot(3,1,3)
plot(t,y2)
title('3*sin(2*pi*40*t)')
%濾波器的幅頻相頻曲線
figure(2)
[h,w] = freqz(filtb,filta,256);
%[h,f] = freqz(filtb,filta,256,Fs);
subplot(2,1,1)
plot(w/pi,20*log10(abs(h)))
%plot(f,20*log10(abs(h)))
xlabel('\times\pi')
%xlabel('Hz')
ylabel('gain(dB)')
subplot(2,1,2)
plot(w/pi,angle(h))
%plot(f,angle(h))
xlabel('\times\pi')
%xlabel('Hz')
ylabel('phase (rad)')
%% 設(shè)計(jì)阻帶為30HZ-60Hz的6階巴特沃斯帶阻濾波器
% [filtered_signal,filtb,filta] = bandstop_butterworth(inputsignal,cutoff_freqs,Fs,order)
% INPUTS:
% inputsignal = input time series
% cutoff_freqs = filter corner frequencies in the form [f1 f2]
% Fs = data sampling frequency
% order = order of Butterworth filter
% OUTPUTS: 
% filtered_signal = the filtered time series
% filtb, filta = filter numerator and denominator (optional)
clear;clc;
t=0:0.005:5;
T=0.005;%時(shí)間間隔
Fs=1/T;%采樣頻率
y1=5*sin(2*pi*10*t)+3*sin(2*pi*40*t)+6*sin(2*pi*80*t);
y2=5*sin(2*pi*10*t)+6*sin(2*pi*80*t);
[filtered_signal,filtb,filta]=bandstop_butterworth(y1,[30 60],Fs,6);
figure(1)
subplot(3,1,1)
plot(t,y1)
title('原始信號(hào)')
subplot(3,1,2)
plot(t,filtered_signal)
title('濾波后信號(hào)')
subplot(3,1,3)
plot(t,y2)
title('5*sin(2*pi*10*t)+6*sin(2*pi*80*t)')
%濾波器的幅頻相頻曲線
figure(2)
[h,w] = freqz(filtb,filta,256);
%[h,f] = freqz(filtb,filta,256,Fs);
subplot(2,1,1)
plot(w/pi,20*log10(abs(h)))
%plot(f,20*log10(abs(h)))
xlabel('\times\pi')
%xlabel('Hz')
ylabel('gain(dB)')
subplot(2,1,2)
plot(w/pi,angle(h))
%plot(f,angle(h))
xlabel('\times\pi')
%xlabel('Hz')
ylabel('phase (rad)')

注:bandpass_butterworth和bandstop_butterworth函數(shù)不為MATLAB自帶函數(shù)。這兩個(gè)函數(shù)可在e小白官網(wǎng)《MATLAB設(shè)計(jì)帶通和帶阻巴特沃斯濾波器》文章中下載。

MATLAB設(shè)計(jì)帶通和帶阻巴特沃斯濾波器的評論 (共 條)

分享到微博請遵守國家法律
临泽县| 嘉义县| 民县| 阿拉善右旗| 大城县| 潮州市| 西昌市| 永川市| 开原市| 黔东| 石棉县| 民权县| 辽阳县| 平湖市| 文登市| 九台市| 神池县| 昌都县| 岱山县| 宁海县| 浦江县| 渑池县| 大名县| 儋州市| 牙克石市| 贡觉县| 阿勒泰市| 东明县| 紫阳县| 海盐县| 高碑店市| 雷州市| 密云县| 新丰县| 阜新| 常熟市| 图木舒克市| 峨边| 沂南县| 界首市| 方山县|