Professional Documents
Culture Documents
Problem 2
Problem 2
total_time = 5; % in sec.
figure
% type "help plot" (without the double quote) under MATLAB console to see the usage of plot().
% type "help stem" to see the usage of stem().
%plot((0:1/(f0*100):total_time), x_CT,'-o', 'linewidth', 2);
plot((0:1/(f0*100):total_time), x_CT,'-', 'linewidth', 2); % CT signal
hold on
stem(t, x_DT,'r', 'linewidth', 2); % DT signal
plot(t, x_DT,'r', 'linewidth', 2); % connet the dots, i.e., connect DT x[n]
xlabel('Time (sec.)');
ylabel('x(nT)');
title('Discrete time sinusoid (time domain)');
axis([0 1/f0*50 -A A]); % only observe the signal from time 0 to time 1/f0*3. once you remove
legend('x(t)', 'x[n]', 'connected x[n]')
1
2.(a)fsRatio 從20降到2之間只有大小聲的變化,變成1.8的時候因為取樣的間隔太大所以音高變了
2.(b)f0改變了。最小的fsRatio是2,如果比2小的話取樣就會偏離
f0 = 1000; % in Hz
total_time = 5; % in sec.
figure
% type "help plot" (without the double quote) under MATLAB console to see the usage of plot().
% type "help stem" to see the usage of stem().
2
%plot((0:1/(f0*100):total_time), x_CT,'-o', 'linewidth', 2);
plot((0:1/(f0*100):total_time), x_CT,'-', 'linewidth', 2); % CT signal
hold on
stem(t, x_DT,'r', 'linewidth', 2); % DT signal
plot(t, x_DT,'r', 'linewidth', 2); % connet the dots, i.e., connect DT x[n]
xlabel('Time (sec.)');
ylabel('x(nT)');
title('Discrete time sinusoid (time domain)');
axis([0 1/f0*50 -A A]); % only observe the signal from time 0 to time 1/f0*3. once you remove
legend('x(t)', 'x[n]', 'connected x[n]')
2.(c)會,不管取多少的fsRatio依然會是週期函數(如圖示fsRation=1.74仍然有週期性)