please how to write this in matlab?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
fourier function
- define a sum of cosine waves f=8 HZ
- build it's plot in time domain
- build the plot of it's magnitude spectrumi don't understand how to use the arry in matlab :( :(
0 commentaires
Réponses (2)
Ngoc Thanh Hung Bui
le 16 Avr 2018
I dont really understand the problem, better more specifically
0 commentaires
KALYAN ACHARJYA
le 16 Avr 2018
Modifié(e) : KALYAN ACHARJYA
le 16 Avr 2018
% Are you looking for this one t=0:1:115; fs=500 % Assumed Sampling Frequency f=8; % Given 8 Hz cw=cos(2*pi*f/fs*t); subplot(121);stem(cw,'r'); title('Time Domain'); %Read in Signal Processing Book How to find Magnitute Response fftLength=512; sigLength=length(cw); win=rectwin(sigLength)'; % Window Selection 'Ractangular' y=fft(cw.*win,fftLength); length=fftLength/2+1; % Magnitude Response subplot(122);plot([1:length]*fs/(2*length),abs(y(1:length))); title('Magnitude Response');
![](/matlabcentral/answers/uploaded_files/113342/cos.jpg)
2 commentaires
Voir également
Catégories
En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!