资源简介
多通道滤波器组的matlab实现程序,有需要的可以下载参考
代码片段和文件信息
tic; %beginning time
clear; clc;
%%
%====================
M = 3; % there are 3 channels
N = 256;
n = -N : N;
fs = 100; % sample frequency
dt = 1/fs;
t = n * dt;
t1 = linspace(-N*dtN*dt((2*N+1)*M));
mu0 = -20; % the chirp frequency
f0 = 5; % center frequency of the first signal x0
f1 = 35; % center frequency of the second signal x1
f2 = 70; % center frequency of the third signal x2
alfa = acot(-mu0);
du=2*pi*abs(sin(alfa))/(dt*(2*N+1));
u = linspace(-pi*abs(sin(alfa)) pi*abs(sin(alfa)) 2 * N + 1);
u1 = linspace(-pi*abs(sin(alfa)) pi*abs(sin(alfa)) ((2*N+1)*M));
uu = linspace(0 2*pi*abs(sin(alfa)) 2 * N + 1);
uu1 = linspace(0 2*pi*abs(sin(alfa)) ((2*N+1)*M));
%%
x0 = exp(j * 0.5 * mu0 * t .^ 2 + j * 2 * pi * f0 * t);
x1 = exp(j * 0.5 * mu0 * t .^ 2 + j * 2 * pi * f1 * t);
x2 = exp(j * 0.5 * mu0 * t .^ 2 + j * 2 * pi * f2 * t);
%%%%% the frft of the original signal
xx0 = dfrft3(x0 alfa N N dt);
xx1 = dfrft3(x1 alfa N N dt);
xx2 = dfrft3(x2 alfa N N dt);
%%
max0_1 = max(abs(xx0));
max1_1 = max(abs(xx1));
max2_1 = max(abs(xx2));
%%
%%%%% to plot the original signal and its frft sprctrum
%%%========= for the first signal
figure(1);
subplot(211);
plot(treal(x0));
title(‘the first original signal x0‘);
ylabel(‘x0(t)‘);
xlabel(‘t‘)
% axis([-N*dt N*dt -1 1]);
subplot(212);
plot(uabs(fftshift(xx0)));
title(‘the frft of the first original signal x0‘);
ylabel(‘xx0(u)‘);
xlabel(‘u‘);
%%%========= for the second signal
figure(11);
subplot(211);
plot(treal(x1));
title(‘the second original signal x1‘);
ylabel(‘x1(t)‘);
xlabel(‘t‘)
% axis([-N*dt N*dt -1 1]);
subplot(212);
plot(uabs(fftshift(xx1)));
title(‘the frft of the second original signal x1‘);
ylabel(‘xx1(u)‘);
xlabel(‘u‘);
%%%========= for the third signal
figure(12);
subplot(211);
plot(treal(x2));
title(‘the third original signal x2‘);
ylabel(‘x1(t)‘);
xlabel(‘t‘)
% axis([-N*dt N*dt -1 1]);
subplot(212);
plot(uabs(fftshift(xx2)));
title(‘the frft of the third original signal x2‘);
ylabel(‘xx1(u)‘);
xlabel(‘u‘);
%%
%%%%%% interpolation by M = 3
%%%
N2 = floor(M*(2*N+1)-1)/2;
%%%s0 is the first interpolated signal
s0 = upsample( x0 M);
ss0 = dfrft3(s0 alfa N2 N2 dt/M); %ss0 is the first frft of s0 with angle of alfa
max0_2 = max(abs(ss0));
%%%s1 is the second interpolated signal
s1 = upsample( x1 M);
ss1 = dfrft3(s1 alfa N2 N2 dt/M); %ss1 is the second frft of s0 with angle of alfa
max1_2 = max(abs(ss1));
%%%s2 is the third interpolated signal
s2 = upsample( x2 M);
ss2 = dfrft3(s2 alfa N2 N2 dt/M); %ss2 is the third frft of s0 with angle of alfa
max2_2 = max(abs(ss2));
%%
%%%%%% filtering
h0 = zeros(1 2 * N * M + 3);
h1 = h0;
h2 = h0;
%%%======== filtering for the first interpolated signal
h0([2*N+2 : 4*N+2]) = M*ones(1 length([2*N+1 : 4*N+1])); % the first filter
% ss0 = fftshift(ss0);
v0 = ss0 .*
评论
共有 条评论