Usually, power spectrum is desired for analysis in frequency domain. Representing the given signal in frequency domain is done via Fast Fourier Transform (FFT) which implements Discrete Fourier Transform (DFT) in an efficient manner. X=sin(2*pi*f*t+phase) %replace with cos if a cosine wave is desired NCyl = 5 %to generate five cycles of sine wave Phase = 1/3*pi %desired phase shift in radians If a phase shift is desired for the sine wave, specify it too. A oversampling factor of is chosen here – this is to plot a smooth continuous-like sine wave (If this is not the requirement, reduce the oversampling factor to desired level). In order to generate/plot a smooth sine wave, the sampling rate must be far higher than the prescribed minimum required sampling rate which is at least twice the frequency – as per Nyquist Shannon Theorem. Matlab is a software that processes everything in digital. Now that you have determined the frequency of the sinewave, the next step is to determine the sampling rate. For example, I intend to generate a f=10 Hz sine wave whose minimum and maximum amplitudes are and respectively. In order to generate a sine wave in Matlab, the first step is to fix the frequency of the sine wave.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |