📄 fft8_d.m
字号:
clear;
clc;
close all;
%DFT滤波器组
%参数:旁瓣——13dB 主瓣3dB点——0.06*pi 滤波器点数:8
fiter_f=dftmtx(8);
fiter_r=abs(real(fiter_f));
fiter_i=abs(imag(fiter_f));
fiter_m=max(max(max(fiter_r)),max(max(fiter_i)));
fiter_f=round(fiter_f/fiter_m*(2^15-1));
fvtool(fiter_f(:,1),1,fiter_f(:,2),1,fiter_f(:,3),1,fiter_f(:,4),1,fiter_f(:,5),1,fiter_f(:,6),1,fiter_f(:,7),1,fiter_f(:,8),1);
N_point=256;
inval=2*pi/N_point;
f_point= linspace(0,2*pi-inval,256);
nomiga=(0:15)'*ones(1,256)*diag(f_point);
f_points=exp(j*nomiga);
f_r=abs(real(f_points));
f_i=abs(imag(f_points));
f_m=max(max(max(f_r)),max(max(f_i)));
f_points=round(f_points/f_m*(2^15-1));
f_points=conj(f_points');
% f_r=abs(real(f_points));
% f_i=abs(imag(f_points));
f_points1=f_points(:,1:8);
f_points2=f_points(:,9:16);
outiq1=f_points1*fiter_f;
outiq2=f_points2*fiter_f;
y1=abs(outiq1);
y2=abs(outiq2);
y_max1=round(max(max(y1)));
y_max2=round(max(max(y2)));
y_max=round(max(y_max1,y_max2));
y_bin=dec2base(y_max,2)
y_bin_size=size(y_bin)
y1=y1/y_max;
y2=y2/y_max;
y1=20*log10(y1+eps);
y2=20*log10(y2+eps);
plot(f_point/pi,y1, 'DisplayName', 'y');
hold on
plot(f_point/pi,y2, 'DisplayName', 'y');
axis([0,2,-35,2])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -