how to find FFT for pure sine wave in simulink?

6 visualizaciones (últimos 30 días)
swarnalakshmi N
swarnalakshmi N el 18 de Mzo. de 2017
Respondida: Hari el 28 de Mayo de 2025
i would like to find FFT for pure sine wave in simulink without using FFT spectrum, is it possible?

Respuestas (1)

Hari
Hari el 28 de Mayo de 2025
Hi Swarnalakshmi,
I understand that you want to compute the Fast Fourier Transform (FFT) of a pure sine wave in Simulink without using the “FFT Spectrum” block.
In order to find the FFT for a pure sine wave in Simulink without using the “FFT Spectrum” block, you can follow the below steps:
Generate the Sine Wave:
Use the “Sine Wave” block in Simulink to create a pure sine wave signal. Configure the frequency, amplitude, and sample time according to your requirements.
Buffer the Signal:
Use the “Buffer” block to collect a sequence of samples over a specified frame size. This is necessary because FFT operates on a block of data rather than a continuous stream.
Implement FFT Logic:
Use the “MATLAB Function” block to write a custom function that takes the buffered data as input and computes the FFT using MATLAB’s “fft” function.
function Y = computeFFT(u)
Y = fft(u); % Compute FFT
end
Calculate Magnitude:
Use the “Abs” block to calculate the magnitude of the FFT output. This gives the amplitude spectrum of the signal.
Visualize the Spectrum:
Use the “Scope” block to visualize the amplitude spectrum. Ensure the x-axis represents frequency by configuring the simulation parameters appropriately.
Refer to the documentation of “fft” function to know more about its usage:
Hope this helps!

Categorías

Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by