Creating a discrete-time signal as a linear combination of multiple complex sinudoids

Status
Not open for further replies.

Ehsan Mamakani

Newbie level 1
Joined
Jan 13, 2014
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
8
I want to know how to create a discrete time signal as a linear combination of multiple complex sinusoids. And then how to draw signal in Matlab. Finally, if I have a LTI system impulse response, what should I do to find the output of the system?
Any help is so much appreciated, it would be so helpful if answered with a useful link or examples.
 

You can perform Discrete-time Fourier transform on your ideal waveform to generate , and try to simulate it as an sum of sinus signalq with extracted frequency components and their magnitute.
 

You can perform Discrete-time Fourier transform on your ideal waveform to generate , and try to simulate it as an sum of sinus signalq with extracted frequency components and their magnitute.
Yes, to extend axcdd's answer, if you type "help fft" into Matlab, you will find:



So, writing that out in Matlab:
Code:
close all; clear all; clc;

% Some random example data
N = 100;
x = randn(N,1);

% Compute FFT
X = fft(x);

% Inverse FFT is sum of complex sines
x_sum = zeros(N,1);
for n = 1:N
    for k = 1:N
        x_sum(n) = x_sum(n) + X(k)*exp(1j*2*pi*(k-1)*(n-1)/N);
    end
end
x_sum = x_sum/N;

% The same as x_sum, but in compact matrix form
x_sum2 = ifft(eye(N))*X;

% Plot results
plot(x,'k'); hold on; grid on;
plot(real(x_sum), '--r');
plot(real(x_sum2), ':g');  
legend('Original Input','Sum of complex sines', 'Matrix expression');

where exp(jx) = cos(x) + jsin(x).
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…