Code covered by the BSD License  

Highlights from
MatLab Solutions: "Introduction to Digital Signal Processing: A Computer Laboratory Textbook".

image thumbnail

MatLab Solutions: "Introduction to Digital Signal Processing: A Computer Laboratory Textbook".

by

 

29 Oct 2012 (Updated )

These files are the MatLab solutions of exercises contained in the above DSP lab textbook.

ifft241(X,Y)
function [x y] = ifft241(X,Y)
% This function calculates the IDFT's of 2 given complex DFT sequences of common length N,
% using a single inverse fft of a combined complex sequence of the same duration.
% X and Y must be the DFT's of 2 real signals of common length in order for this method to work.
% i.e. Re{X[k]} and Re{Y[k]} should be even and Im{X[k]} and Im{Y[k]} should be odd.
%
% Also, the symmetry of Re{X[k]} and Re{Y[k]} as well as of Im{X[k]} and Im{Y[k]} should be identical.
% i.e. Re{X[k]} and Re{Y[k]} should both have even or odd symmetry around the middle sample.
% also, Im{X[k]} and Im{Y[k]} should  both have even or odd symmetry around the middle sample.

% Plot the real and imaginary parts of the input sequences for diagnostic purposes.
% figure();
% subplot(2,2,1);
% stem(real(X),'b.');
% title('\Ree\{X[k]\}');
% grid;
% axis tight;
% 
% subplot(2,2,3);
% stem(real(Y),'b.');
% title('\Ree\{Y[k]\}');
% grid;
% axis tight;
% 
% subplot(2,2,2);
% stem(imag(X),'r.');
% title('\Imm\{X[k]\}');
% grid;
% axis tight;
% 
% subplot(2,2,4);
% stem(imag(Y),'r.');
% title('\Imm\{Y[k]\}');
% grid;
% axis tight;

Z = X + 1i*Y;

z = ifft(Z);
 
x = real(z);
y = imag(z);

Contact us