how to find FFT for pure sine wave in simulink?

6 vues (au cours des 30 derniers jours)
swarnalakshmi N
swarnalakshmi N le 18 Mar 2017
Réponse apportée : Hari le 28 Mai 2025
i would like to find FFT for pure sine wave in simulink without using FFT spectrum, is it possible?

Réponses (1)

Hari
Hari le 28 Mai 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!

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by