Question

WebLearn Mathematice and Statistics for Manufacturing Engineers (MATH2185 1910) Student Test Page-Fourier series and DFT C 29

format compact

format long

clear

y=[-0.003, 0.197, 0.3, 0.402, 0.496, 0.603, 0.7, 0.797, 0.996, 1.02];

Y=fft(y);

%% Display F[k]

fmt=strcat(['%d',' ','%-14.10f','+i(','%-14.10f',')']);

disp(sprintf('\nk F[k]'));

for ic=1:length(Y)

disp(sprintf(fmt,ic-1,real(Y(ic)),imag(Y(ic))));

end

%%

0 0
Add a comment Improve this question Transcribed image text
Answer #1

%%%%%%%%%% Matlab code %%%%%%5

clc;
close all;
clear all;
format long
y=[-0.002 0.203 0.303 0.395 0.495 0.598 0.699 0.801 0.999];
yk=fft(y);
fprintf(' Real part of F(1) = %1.5f \n' ,real(yk(2)) );
fprintf(' Imaginary part of F(1) = %1.5f \n',imag(yk(2)));

OUTPUT:

Real part of F(1) = -0.46359
Imaginary part of F(1) = 1.30059   

Add a comment
Know the answer?
Add Answer to:
format compact format long clear y=[-0.003, 0.197, 0.3, 0.402, 0.496, 0.603, 0.7, 0.797, 0.996, 1.02]; Y=fft(y); %% Dis...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • format compact format long clear y=[-0.003, 0.197, 0.3, 0.402, 0.496, 0.603, 0.7, 0.797, 0.996, 1.02]; Y=fft(y);...

    format compact format long clear y=[-0.003, 0.197, 0.3, 0.402, 0.496, 0.603, 0.7, 0.797, 0.996, 1.02]; Y=fft(y); %% Display F[k] fmt=strcat(['%d',' ','%-14.10f','+i(','%-14.10f',')']); disp(sprintf('\nk F[k]')); for ic=1:length(Y) disp(sprintf(fmt,ic-1,real(Y(ic)),imag(Y(ic)))); end %% WebLearn Mathematics and Statistics for Manufacturing Engineers (MATH2185 1910) Student Test Page Fourier series andDF Question the discrete Founer transtorm is detined as: Fk-Lje k0,1,2. ..,N-1 1=0 The following nine data values are measured at evenly spaced time intervals: -0.011, 0.688, 0.983, 0.717, -0.001, -0.687, -0.952, -0.701, 0.01 For this test data,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT