fourier transform in matlab

Status
Not open for further replies.

itmr

Member level 3
Joined
Nov 5, 2010
Messages
55
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,750
hi everybody

i need to calculate and plot fourier transform to the func
x1_t = [sin(2*50*t.*pi)]./ (2*50*t.*pi);
i coded the transform like this and getting nothing at the plot

omega = [-2*pi*500 : pi : 2*pi*500];

X1_w = zeros(size(omega)); % decleration of the transform results
for i = 1 : length(omega)
X1_w(i) = trapz(t,x1_t.*exp(-j*omega(i)*t)); %Fourier Transform
end
X1_w_magnitude = abs(X1_w); %Magnitude of the Fourier Transform
figure (4)
plot(omega,X1_w_magnitude,'LineWidth',2);

could someone have any idea that can help me??
 

what about using the command:
Code:
plot(abs(fftshift(fft(x1_t))))
 

Hi itmr,

Please tell whether you are speaking about discrete- or continuous time- Fourier transforms.
How is the vector "t" defined?

Advice: "i" is by default the imaginary unit in Matlab (like "j"). Don't use it as the name of a variable. It will work, but it can be a source of confusion and potential errors.

Regards

Z
 

hi

THANK ALL IT WAS HELP ME A LOT
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…