필터 지우기
필터 지우기

Draw Signal graph from a frequency domain representation

조회 수: 13 (최근 30일)
Md Naeemur Rahman
Md Naeemur Rahman 2021년 4월 22일
댓글: Star Strider 2021년 4월 24일
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