image thumbnail

EXPO 2011 Signal Processing Workflow Demo Files

by

 

MATLAB EXPO 2011 Signal Processing Workflow Demo Files

fresp_sl.m
%% Simulinkf̎g
close all, clear all

%% p[^ݒƃfI[v
[num,den]=butter(4, 1500,'s')
f1 = linspace(1,1e4,1000);
figure
h1=freqs(num,den,f1*2*pi);
% f1 = w1/(2*pi);
mag1 = 20*log10(abs(h1));
phase1 = angle(h1)*180/pi;
subplot(2,1,1), semilogx(f1,mag1,'b-','LineWidth',2),grid on
axis([10 1e3 -60 10])
subplot(2,1,2), semilogx(f1,phase1,'b-','LineWidth',2),grid on
axis([10 1e3 -200 200])

open_system('tfs1')
%% ԋԐ`f擾
[A,B,C,D]=linmod(bdroot)
[nums,dens] = ss2tf(A,B,C,D)

%% g̕\
h2 = freqs(nums,dens,f1*2*pi);
mag2 = 20*log10(abs(h2));
phase2 = angle(h2)*180/pi;
subplot(2,1,1), hold on
semilogx(f1,mag2,'r:','LineWidth',2),grid on
axis([10 1e3 -60 10])
subplot(2,1,2), hold on
semilogx(f1,phase2,'r:','LineWidth',2),grid on
axis([10 1e3 -200 200])

%% f̃N[Y
close_system('tfs1')

%% UVXȅꍇ
[num,den]=butter(8, [0.1 0.25],'bandpass')
f1 = linspace(1,1e4,1000);
figure
hfv = fvtool(num,den)
open_system('tfz1')

%% ԋԐ`f擾
[A,B,C,D]=dlinmod(bdroot,1)		% Tv=1
[numz,denz] = ss2tf(A,B,C,D)

%% g̕\
addfilter(hfv,numz,denz)
legend(hfv,'Original', '肵g')

%% f̃N[Y
close_system('tfz1')

%% n̓o̓f[^gƓ`B֐𐄒
% ł́An̓o̓f[^Agh
% g𐄒肵Aɓ`B֐𐄒肷܂B

% 肷郂f̍쐬
fs = 44100;
[numh,denh] = yulewalk(20,(0:0.1:1),[0.01 0.01 0.02 0.03 0.06 1 1 0.5 0.2 0 0]);
hfv = fvtool(numh,denh);

%% zCgmCY
x = randn(16384,1);
% o͐MɃmCYƃItZbg̕t
y = filter(numh,denh,x)+0.02*randn(size(x))+2;

%% o͂g
y = detrend(y);							% ϒl`gh̏
[Tyy, f] = tfestimate(x,y,1024,[],[]);	% g̐

%% `B֐̐
[numt,dent] = invfreqz(Tyy,f,50,50)		% `B֐
addfilter(hfv,numt,dent)
legend(hfv,'Original', '肵g')


Contact us