Finding correct phase and magnitude for Simulink continuous singal using FFT block?
2 次查看(过去 30 天)
显示 更早的评论
I have the following script to find the magnitude and the phase at a specific frequency. for scripted signal I used the following: w1=40; A1=100; w2=100; A2=50; Ts=1e-5; fs=1/Ts; t=0:Ts:0.5-1/fs; ************* y=A1*sin(2*pi*w1*t+50/A1)+A2*sin(2*pi*w2*t+20/A2); SignalLength=length(y) Y=fft(y,SignalLength); Signal_mag=2*abs(Y)/SignalLength; Signalphs=unwrap(angle(Y)); freq=ceil(w1*SignalLength/fs); mag_Des=Signal_mag(freq) phase_Des=Signalphs(freq)
I want to do the same for Simulink continuous signal, my problem is that the signal length is 500001 (which I get it from Zero-Order-Hold and buffer, not 50000 to get the correct phase and magnitude as what in the script. any Ideas how to find the correct sampling time, magnitude and phase for my Simulink signal, Please?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Transforms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!