Draw Signal graph from a frequency domain representation
13 views (last 30 days)
Show older comments
How can i Draw the signal graph from this frequency domain over interval [0; 50] ms
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/593435/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/593775/image.png)
0 Comments
Answers (1)
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
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.
See Also
Categories
Find more on Transforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!