フィルターデザイナーで設計したHPFの正弦波特性

18 visualizaciones (últimos 30 días)
Kenji
Kenji el 30 de Abr. de 2023
Respondida: Kenji el 2 de Mayo de 2023
フィルタデザイナで以下のようなHPFを設計しました。
このフィルタに振幅1, 周波数75Hzの正弦波を入れてみると、以下のような応答が得られました(青は振幅±1, 赤がフィルタ出力)。上のゲイン特性では75Hzでは少なくとも-30dBの減衰を実現できるはずですが、実際は振幅が1→0.03程度なので-14dBといったところです。この差が生まれるのはなぜでしょうか?ちなみに50Hz正弦波入力では出力振幅は0.001程度(-30dB)、上のゲイン特性では-50dB以下。
function Hd = chevyshev_65_100
%CHEVYSHEV_65_100 離散時間フィルター オブジェクトを返します。
% MATLAB Code
% Generated by MATLAB(R) 9.14 and Signal Processing Toolbox 9.2.
% Generated on: 30-Apr-2023 10:38:10
% Chebyshev Type I Highpass filter designed using FDESIGN.HIGHPASS.
% All frequency values are in Hz.
Fs = 20000; % Sampling Frequency
Fstop = 65; % Stopband Frequency
Fpass = 100; % Passband Frequency
Astop = 40; % Stopband Attenuation (dB)
Apass = 1; % Passband Ripple (dB)
match = 'passband'; % Band to match exactly
% Construct an FDESIGN object and call its CHEBY1 method.
h = fdesign.highpass(Fstop, Fpass, Astop, Apass, Fs);
Hd = design(h, 'cheby1', 'MatchExactly', match);
% make dummy sin wave
t=0:0.00005:1;
freq2=75;
signal2=sin(2*pi*freq2*t);
ux=signal2;
% apply filter to dummy data
yf5=filter(Hd,ux);
% check result in time domain
plot(t,ux,t,yf5)
ylim([-0.1,0.1])
ylabel('amplitude')
xlabel('t [s]')
legend('Raw Data','Filtered Data(butter,12dim)')
% [EOF]
  1 comentario
Hiroshi Iwamura
Hiroshi Iwamura el 1 de Mayo de 2023
dB の定義はパワー比の対数の10倍です。
振幅の場合は2乗する必要があります。
Fs = 20000; % Sampling Frequency
Fstop = 65; % Stopband Frequency
Fpass = 100; % Passband Frequency
Astop = 40; % Stopband Attenuation (dB)
Apass = 1; % Passband Ripple (dB)
match = 'passband'; % Band to match exactly
h = fdesign.highpass(Fstop, Fpass, Astop, Apass, Fs);
Hd = design(h, 'cheby1', 'MatchExactly', match);
t=0:0.00005:1;
freq2=75;
signal2=sin(2*pi*freq2*t);
ux=signal2;
yf5=filter(Hd,ux);
plot(t,ux,t,yf5)
ylim([-0.1,0.1])
ylabel('amplitude')
xlabel('t [s]')
legend('Raw Data','Filtered Data(butter,12dim)')
figure
plot(t,mag2db(ux),t,mag2db(yf5)) % mag2db(x) = 20*log10(x)
ylim([-50 0])

Iniciar sesión para comentar.

Respuestas (1)

Kenji
Kenji el 2 de Mayo de 2023
すっきりしました。ご回答ありがとうございました。

Community Treasure Hunt

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

Start Hunting!