Magnitude & Phase output for FFT Function with Windowing

Debdatta_Sen
Debdatta_Sen
Altair Employee
edited October 2020 in Community Q&A

Hi all,

I have a time domain curve which I would like to convert into frequency domain.

By doing so I would like to obtain the magnitude and phase output from the curve. 
I need the Windowing function as well. Something like what fft hanning does in HyperGraph.
Is there a similar function in Compose?
The output I need should have both Magnitude and Phase components, something like this:

<?xml version="1.0" encoding="UTF-8"?>grafik.thumb.png.51dde0ae7d300785547232d9ac411b5b.png
 

Tagged:

Answers

  • L Moretti
    L Moretti New Altair Community Member
    edited May 2020

    Hello Debdatta,

     

    you can use the user defined function (attached to this reply) with this syntax:

     

    [AmpFFT,PhFFT,f] = FFTeval(s,Fs);

     

    s: your signal values

    Fs: sampling frequency

    AmpFFT: apmlitude of the single sided spectrum

    PhFFT: Phase of the single sided spectrum

    f: frquency vector

     

    you can then plot your results:

     

    figure()

    plot(f,AmpFFT)

    figure()

    plot(f,PhFFT)

     

    Of course you can also apply windows to your signal. There are many built windows ready to be used.

    Your script will be:

     

    w = hann(numel(s),'periodic');  %window

    s = s .* w;  % windowing 

    [AmpFFT,PhFFT,f] = FFTeval(s,Fs);

     

    Other windows you can use:  hamming, kaiser, blackman... (just look inside the SignalProcessing library)

     

    Hope it helps,

     

    Lorenzo

     

     

    Unable to find an attachment - read this blog

  • manoj kandukuri
    manoj kandukuri
    Altair Employee
    edited February 2021

    Hi Debdatta, 

    You can use 'real' & 'angle' commands to get magnitude and phase of fft signal

     

    real(ft)
    angle(ft)

     

    thanks,

    Manoj kandukuri