Finding correct phase and magnitude for Simulink continuous singal using FFT block?

2 Ansichten (letzte 30 Tage)
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?

Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by