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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/593435/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/593775/image.png)
0 个评论
回答(1 个)
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 个评论
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Transforms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!