main.m666 chars25 lines
This MATLAB code snippet computes the frequencies and amplitudes of the first seven Fourier coefficients of a rectified half-wave 50 Hz sine wave. The code first generates a 50 Hz sine wave, rectifies it to obtain the half-wave rectified sine wave, and then computes the Fourier coefficients using a loop. Finally, it calculates the frequencies and amplitudes of the Fourier coefficients and displays them in the command window.
gistlibby LogSnag