Showing posts with label Fourier transform. Show all posts
Showing posts with label Fourier transform. Show all posts

MATLAB program to find the Fourier transform of an exponential curve

Progam code
clc;
clear all;
close all;
t=0:0.001:1;
a=input('Please enter the multiplication factor of an exponential curve ');
cwtstruct = cwtft(exp(a*t),'plot');

Example of output
Please enter the multiplication factor of an exponential curve  5


_____________________________

If you find this program code useful, then please deposit 5 Indian Rupees in my bank account, as my fee. (Citizens of Pakistan cannot do this.).
I am the woman who wrote this program code.
My name: Anju K.
My bank account number: 30221619108
Bank: State Bank of India, Chakkarakkal branch, India.
IFSC code: SBIN0070728
SWIFT code: SBININBB
BIC code: SBININBB
My email: tc9749@gmail.com .


MATLAB program to find the Fourier Transform of cosine wave

Program code

clc;
clear all;
close all;
t=0:0.001:1;
cwtstruct = cwtft((cos(2*3.14*1000*t)),'plot');


Output

______________________________________

If you find this program code useful, then please deposit 5 Indian Rupees in my bank account, as my fee. (Citizens of Pakistan cannot do this.).
I am the woman who wrote this program code.
My name: Anju K.
My bank account number: 30221619108
Bank: State Bank of India, Chakkarakkal branch, India.
IFSC code: SBIN0070728
SWIFT code: SBININBB
BIC code: SBININBB
My email: tc9749@gmail.com .


MATLAB program to find out the Fourier Transform of sinusoidal waveform

Program code
clc;
clear all;
close all;
t=0:0.001:1;
cwtstruct = cwtft((sin(2*3.14*1000*t)),'plot');


Output


________________________

If you find this program code useful, then please deposit 5 Indian Rupees in my bank account, as my fee. (Citizens of Pakistan cannot do this.).
I am the woman who wrote this program code.
My name: Anju K.
My bank account number: 30221619108
Bank: State Bank of India, Chakkarakkal branch, India.
IFSC code: SBIN0070728
SWIFT code: SBININBB
BIC code: SBININBB
My email: tc9749@gmail.com .



MATLAB program to find DFT and IDFT using matlab functions

Program Code
%DFT and IDFT using matlab functions
clc;
close all;
clear all;
x=input('Please enter the sequence x(n)=');
N=input('Please enter the length of the DFT N=');
X=fft(x,N);
n=0:length(x)-1;
subplot(311);
stem(n,x);
title('Input Sequence');
subplot(323);
n=0:length(X)-1;
stem(n,X);
disp('DFT of input sequence is ');
disp(X);
title('DFT');
subplot(324);
stem(n,abs(X));
title('Magnitude spectrum');
subplot(325);
stem(n,angle(X));
title('Phase spectrum');
xr=ifft(x,N);
subplot(326);
stem(n,abs(xr));
title('IDFT');
disp('IDFT of input sequence is ');
disp(xr);
Example of Output
Please enter the sequence x(n)=[1 2 3 4 5 6 7 8 9]
Please enter the length of the DFT N=6
DFT of input sequence is 
  Columns 1 through 4

  21.0000 + 0.0000i      -3.0000 + 5.1962i       -3.0000 + 1.7321i       -3.0000 + 0.0000i

  Columns 5 through 6

  -3.0000 - 1.7321i          -3.0000 - 5.1962i

IDFT of input sequence is 
  Columns 1 through 4

   3.5000 + 0.0000i       -0.5000 - 0.8660i         -0.5000 - 0.2887i       -0.5000 + 0.0000i

  Columns 5 through 6

  -0.5000 + 0.2887i         -0.5000 + 0.8660i
______________________________

If you find this program code useful, then please deposit 5 Indian Rupees in my bank account, as my fee. (Citizens of Pakistan cannot do this.).
I am the woman who wrote this program code.
My name: Anju K.
My bank account number: 30221619108
Bank: State Bank of India, Chakkarakkal branch, India.
IFSC code: SBIN0070728
SWIFT code: SBININBB
BIC code: SBININBB
My email: tc9749@gmail.com .