Draw Signal graph from a frequency domain representation

13 次查看(过去 30 天)
How can i Draw the signal graph from this frequency domain over interval [0; 50] ms

回答(1 个)

Star Strider
Star Strider 2021-4-22
That is not possible with only the information shown in the plot image.
Inverting the Fourier transform of the signal requires that both the real and imaginary parts be present. These can be recovered from the amplitude and phase spectrum data if both are provided (that is essentially trivial), however without the phase data, half the necessary data are lost, and so inverting the Fourier transform is not possible.
  8 个评论
Md Naeemur Rahman
Md Naeemur Rahman 2021-4-24
t=0: 1e-3: 50e-3;
y1 = 1.5+2*sin(2*pi*100*t)+sin(2*pi*300*t)+0.5*sin(2*pi*400*t);
p = plot(t,y1);
I also tried this way, I'm not sure which approach would be more accurate
Star Strider
Star Strider 2021-4-24
Yes!
Choose an appropriate sampling frequency that meets the requrements for the 50 ms limit and still produces the appropriate result. It may be necessary to do a fft on the result to check it.
An example of that would be —
t = ...; % Time Vector
s = ...; % Signal Vector
L = numel(t); % Signal Length
Ts = mean(diff(t)); % Sampling Interval
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
nfft = 2^nextpow2(L); % FFT Length
FTs = fft(s,nfft)/L; % Fourier Transform
Fv = linspace(0, 1, nfft/2+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
stem(Fv, abs(FTs(Iv))*2)
grid
With —
t = linspace(0,10,500);
s = sin(2*pi*10*t);
(that is simply for demonstration purposes and has no relation to your assignment) that code produces:
L = numel(t); % Signal Length
Ts = mean(diff(t)); % Sampling Interval
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
nfft = 2^nextpow2(L); % FFT Length
FTs = fft(s,nfft)/L; % Fourier Transform
Fv = linspace(0, 1, nfft/2+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
stem(Fv, abs(FTs(Iv))*2)
grid
So you can use it to check the result of your code. It should reproduce the plot you were initially given, and that satisfy the other requrements.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by