Plotting signals in time domain

์กฐํšŒ ์ˆ˜: 24 (์ตœ๊ทผ 30์ผ)
Sadi M Jawad Ahsan
Sadi M Jawad Ahsan 2022๋…„ 5์›” 8์ผ
๋Œ“๊ธ€: Image Analyst 2022๋…„ 5์›” 8์ผ
Q: In the operation of V.34 class voiceband modems, tone signals that are narrowly spaced apart must be quickly identified for initialization. We want to design a signal processing algorithm that can easily detect which signal is received. ITU-T V.25 and V.8 recommendations specify the signals as
๐‘ 0(๐‘ก) = ๐ด0 cos(2๐œ‹๐‘“c๐‘ก + ๐œƒ) : ANS signal
๐‘ 1(๐‘ก) = ๐ด1[1 + ๐œŒ cos(2๐œ‹๐‘“0t + ๐œ™)] cos(2๐œ‹๐‘“c๐‘ก + ๐œƒ) : ANSam signal
The parameters are given by: ๐œŒ = 0.2, ๐‘“0 = 15 Hz, ๐‘“c = 2100 Hz, ๐ด1 = 1, ๐ด0 = ๐ด1(1 +๐œŒ^2/2) Thevalues for ๐œƒ and ๐œ™ are arbitrary.
1. Plot ANS and ANSam signals in the time domain. Use sampling rate ๐‘“s = 1/๐‘‡s = 4๐‘“c(2๐‘› + 1), where ๐‘› = 0,1,2,โ€ฆ. Describe the difference of the two signals.
2. Plot the magnitudes of the Fourier transforms of the two signals. Confirm that ANS is a single tone and ANSam is a sum of three narrowly spaced tones. What is the spacing between the tones in the ANSam signal? [Hint: In order to have a high frequency resolution, the FFT points N must be large enough. Also, you might want to zoom into around f = 2100 Hz to be able to see the narrowly spaced tones clearly.]
My Code:
p = 0.2;
f0 = 15;
fc = 2100;
A1 = 1;
A0 = A1 * ((1 + ((p.^2)/2)))*0.5;
theta = -pi+2*pi*rand(100,1);
phi = -pi+2*pi*rand(100,1);
n = 100;
fs = 4*fc*((2*n)+1); % Sampling frequency
T = 1/fs; % Sampling period
L = fs; % Length of signal
t = (0:L-1)*T; % Time vector
s0 = A0 .* cos((2*pi*fc*t)+theta); % ANS signal
s1 = A1 .* (1+(p*cos((2*pi*f0*t)+phi))) .* cos((2*pi*fc*t)+theta); % ANSam signal
X = [s0,s1];
for i = 1:2
subplot(2,1,i)
plot(t(1:100),X(i,1:100))
title(['Row ',num2str(i),' in the Time Domain'])
end
Problem: It is not giving me a cosine output for the 1st part. I haven't attempted the 2nd part yet. Need help.

์ฑ„ํƒ๋œ ๋‹ต๋ณ€

Image Analyst
Image Analyst 2022๋…„ 5์›” 8์ผ
ํŽธ์ง‘: Image Analyst 2022๋…„ 5์›” 8์ผ
You had theta and phi be column vectors while t was a row vector so it did implicit expansion to a 2-D array which you were not expecting. Plus t had a different number of elements than theta and phi (fix using linspace). Try this:
p = 0.2;
f0 = 15;
fc = 2100;
A1 = 1;
A0 = A1 * ((1 + ((p.^2)/2)))*0.5;
n = 100;
theta = -pi+2*pi*rand(1, n);
phi = -pi+2*pi*rand(1, n);
fs = 4*fc*((2*n)+1); % Sampling frequency
T = 1/fs; % Sampling period
L = fs; % Length of signal
t = linspace(0, T, n); %(0:L-1)*T; % Time vector
s0 = A0 .* cos((2*pi*fc*t)+theta); % ANS signal
s1 = A1 .* (1+(p*cos((2*pi*f0*t)+phi))) .* cos((2*pi*fc*t)+theta); % ANSam signal
X = [s0; s1];
for i = 1:2
subplot(2,1,i)
plot(t(1:100),X(i,1:100))
title(['Row ',num2str(i),' in the Time Domain'])
grid on;
end
  ๋Œ“๊ธ€ ์ˆ˜: 4
Sadi M Jawad Ahsan
Sadi M Jawad Ahsan 2022๋…„ 5์›” 8์ผ
Something like this image
Image Analyst
Image Analyst 2022๋…„ 5์›” 8์ผ
And explain to me why the spectrum should be spikes (like a periodic function like sine or cosine would have) when you're just passing in random numbers?
To me, if you use random numbers, your spectrum will look random, and it does, as expected.

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

์ถ”๊ฐ€ ๋‹ต๋ณ€ (0๊ฐœ)

์นดํ…Œ๊ณ ๋ฆฌ

Help Center ๋ฐ File Exchange์—์„œ Filter Design์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

ํƒœ๊ทธ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by