%Question 1
y=dtmfsig(150006260);
%a
t= linspace(0,0.9,7200)
plot(t,y)
title('DTMF time signal')
xlabel('t (sec)')
ylabel(' y(t)' )
% Part B
fLH= [697, 770, 852, 941, 1209, 1336, 1477]
%Signal divided into 3 sections
fs= 8000
T=1/fs
y1= y(1:2400);
y2=y(2401:4800);
y3=y(4801:7200);
% Seven point DTFT
Dy1= freqz(y1, 1, 2*pi*T*fLH);
Dy1n= abs(Dy1)
% 1
Dy2= freqz(y2, 1, 2*pi*T*fLH);
Dy2n= abs(Dy2)
% 3
Dy3= freqz(y3, 1, 2*pi*T*fLH);
Dy3n= abs(Dy3)
% 2
% In each of these sections I used the given keypad to determine what my
% output would be based on the maximums in the matrix. I wrote what those
% numbers would be under each set of commands but to recap they are in
% order 1,3,2
%c
t1= 600:1:1600
%First DTFT (Need to put points in Dy1n in)
Dc1= freqz(y1, 1, t1.*2.*pi.*T)
Dc1n= abs(Dc1)
plot(t1, Dc1n./abs(max(Dc1n)))
title(' normalized spectrum of decode key 5')
xlabel(' frequency (Hz) ')
ylabel(' magnitude')
Dc2= freqz(y2, 1, t1.*2.*pi.*T)
Dc2n=abs(Dc2)
plot(t1, Dc1n./abs(max(Dc2n)))
title('normalized spectrum of decode key 3')
xlabel('frequency (Hz)')
ylabel('magnitude')
Dc3= freqz(y3, 1,t1.*2.*pi.*T)
Dc3n=abs(Dc3)
plot(t1, Dc1n./abs(max(Dc3n)))
title('normalized spectrum of decode key 8')
xlabel('frequency (Hz)')
ylabel('magnitude')
% In this secion I computed the DTFT of the three segements that I divided
% the signal into and then graphed them.
%d
% For the last part of this question I created a table that shows the
% normalized values for the 3 different key values that are displayed in
% the graphs above
d= [fLH; Dy1; Dy2; Dy3];
fprintf('%6s | %10s %10s %10s\n', 'f', 'key 5', 'key 3', 'key 8') ;
fprintf('-----|------------------------------------------\n');
fprintf('%6.d| %10.3f %10.3f %10.3f\n',d);
publish('lab2question1.m','pdf')
每当我发布此内容时,我都会陷入一个弹出的数字循环中,除非我单击 ctrl+c ,否则不会停止......有关如何解决此问题的任何建议吗?我正在尝试创建一个 pdf 文件,其中包含我放入此代码中的所有图表和注释。第一次使用发布,当我查看 matlab 中发布命令的帮助函数时,似乎我做得正确。