バタワースフィルター (LPF) の周波数スペクトルの書き方

以下は、バタワースフィルター(LPF)のプログラムです。Trace_1は10MHzのsin波のデータ(横軸:時間、縦軸:電圧)です。
x1=Trace_1;
fc=1*10^6;%フィルターのカットオフ周波数
fs=100*10^6;%サンプリング周波数
[b,a]=butter(50,fc/(fs/2));
%freqz(b,a)
x2=filter(b,a,x1);
plot(x2);
バタワースフィルターとx2 (バタワースフィルターにx1を通した後の信号) の周波数スペクトル ( 横軸:周波数(Hz)、縦軸:利得(dB) )の出力方法を教えていただけませんか?ご回答お待ちしております。

1 comentario

Yoshio
Yoshio el 31 de Oct. de 2019
t = Trace_1(:,1);
x = Trace_1(:,2);
plot(t,x)
fs = 1/(t(2)-t(1))
fs =
2.0000e+09
となっていますので、サンプリング周波数の設定は2GHzだと思います。
またfilter(b,a,x1)としていまうと、時系列ベクトルtまでフィルタすることになります。

Iniciar sesión para comentar.

 Respuesta aceptada

Yoshio
Yoshio el 31 de Oct. de 2019

0 votos

先のコメントにも書きましたが、まずご自身のデータTrace_1について理解してください。その上で以下のプログラムが参考になればと思います。
t = Trace_1(:,1);
x = Trace_1(:,2);
plot(t,x)
fs = 1/(t(2)-t(1))
fc = 10^6;
[b,a]=butter(3,fc/(fs/2));
freqz(b,a)
y=filter(b,a,x);
figure
plot(t,[x y]);
grid on;
legend('x','y')
figure
[p,f] = pspectrum([x y],fs);
plot(f,pow2db(p))
grid on
xlabel('Frequency (Hz)')
ylabel('Power Spectrum (dB)')

1 comentario

N/A
N/A el 31 de Oct. de 2019
ご回答頂きありがとうございます。
周波数スペクトルを出力することが出来ました。

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2017a

Etiquetas

Preguntada:

N/A
el 30 de Oct. de 2019

Comentada:

N/A
el 31 de Oct. de 2019

Community Treasure Hunt

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

Start Hunting!