plotting signals in frequency domain
์ด์ ๋๊ธ ํ์
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.
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;
n = 2^nextpow2(L);
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];
dim = 2;
Y = fft(X,n,dim);
P2 = abs(Y/L);
P1 = P2(:,1:n/2+1);
P1(:,2:end-1) = 2*P1(:,2:end-1);
for i=1:2
subplot(2,1,i)
plot(0:(fs/n):(fs/2-fs/n),P1(i,1:n/2))
title(['Row ',num2str(i),' in the Frequency Domain'])
end
Problem: Not getting output. Need help
์ฑํ๋ ๋ต๋ณ
์ถ๊ฐ ๋ต๋ณ (1๊ฐ)
William Rose
2022๋
5์ 8์ผ
ํธ์ง: William Rose
2022๋
5์ 8์ผ
0 ๊ฐ ์ถ์ฒ
[correcting my spelling mstakes]
You have made an excellent start on the problem.
I do not understand your choice of fs. I recommend that you choose fs=5*fc, i.e. sample at 5 times the rate of the main frequency in th problem. This is not really all that fast, because it means you use 5 samples per cycle of the sinusoid, i.e. one point every 72 degrees of phase. I recommend that you construct signals with a duration of 1 second or more. This guarantees that the frequency resolution of the FFT will be 1 Hz (freq resolution=1/duration). If you want a resolution of 0.5 Hz, the signals should be 2 seconds long.
Make a vector of frequencies, which will be the x-axis values of the plot.
Then compute the FFTs, take the absolute value, and plot.
๋๊ธ ์: 3
Sadi M Jawad Ahsan
2022๋
5์ 8์ผ
Sadi M Jawad Ahsan
2022๋
5์ 8์ผ
William Rose
2022๋
5์ 8์ผ
@Sadi M Jawad Ahsan, the plot generated by my code, shown in my answer below, shows three distinct peaks in the S1 spectrum. This indicates three tones: the carrier and the two sidebands. You probably know this, but just in case you don;t this is a classic case of amplitude modulation. p is the modulation index, which should never exceed unity. If you increase p, the sideband amplitude will increase.
์นดํ ๊ณ ๋ฆฌ
๋์๋ง ์ผํฐ ๋ฐ File Exchange์์ Spectral Measurements์ ๋ํด ์์ธํ ์์๋ณด๊ธฐ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
