Draw Signal graph from a frequency domain representation

48 views (last 30 days)
How can i Draw the signal graph from this frequency domain over interval [0; 50] ms

Answers (1)

Star Strider
Star Strider on 22 Apr 2021
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 Comments
Md Naeemur Rahman
Md Naeemur Rahman on 24 Apr 2021
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 on 24 Apr 2021
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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!