滤波器的系统框图
一般问题
发布于 2025-05-18 00:28:46
查看 13过去407天
请问软件能否绘制以下滤波器的系统框图
using WAV
using FFTW
using TyPlot
audio_data, fs = wavread("音频.wav")
if size(audio_data, 2) > 1
y0 = audio_data[:, 1]
else
y0 = audio_data
end
N = length(y0)
n = 0:N-1
f = (n / N .- 0.5) .* fs
Fs = 48000
Fpass1 = 697
Fpass2 = 1477
Fstop1 = 500
Fstop2 = 1600
Wn1 = Fpass1 / (Fs/2)
Wn2 = Fpass2 / (Fs/2)
b, a = butter(2, [Wn1,Wn2],"bandpass")
y0_filtered = DSP.filt(b, a, y0)
figure(1)
TyPlot.plot(n,y0_filtered)
xlabel("t")
ylabel("振幅")
title("滤波后时域图")
grid("on")
figure(2)
fft(y0_filtered)
fftshift(y0_filtered)
plot(f,abs.(y0_filtered))
xlabel("f / Hz")
ylabel("幅度")
title("滤波后频域图")
grid("on")
所属专栏:Syslab基础平台
产品信息:Syslab科学计算环境