Sunday, November 17, 2013

What is Time domain and Frequency domain?

Time/Frequency are interrelated parameter of a signal and both representations are two views of a same signal. Most of the time in practice, the signal measuring, is a function of time. That is TIME-DOMAIN. In other words, when we plot the signal one of the axes is time (independent variable), and the other (dependent variable) is usually the amplitude. When we plot time-domain signals, we obtain a time-amplitude representation of the signal. 



This representation is not always the best representation of the signal for most signal processing related applications. In many cases, the most distinguished information is hidden in the frequency content of the signal. The frequency SPECTRUM of a signal is basically the frequency components (spectral components) of that signal. The frequency spectrum of a signal shows what frequencies exist in the signal. The below represents a signal in time domain and frequency domain.


Demo :

Here the square like wave f is the time domain and it contains 6 different frequencies in it but we are unable to see this information when we are just looking at the TIME DOMAIN representation. So when we take fourier transform of the time domain signal, it reveals the number of frequency it has with amplitude of those frequencies.  This is said to be the Frequency Domain.

In the above demo :

Red Color --- TIME DOMAIN SIGNAL
Blue Color --- FREQUENCY DOMAIN SIGNAL

MATLAB Code:

clear all;
clc;
close all;
f=50;
 A=5;
Fs=f*100;
Ts=1/Fs;
t=0:Ts:10/f;
x=A*sin(2*pi*f*t);
x1=A*sin(2*pi*(f+50)*t);
x2=A*sin(2*pi*(f+250)*t);
x=x+x1+x2; % Creating Hybrid signal which will have more than 1 frequency.
plot(x)
F=fft(x);
figure
N=Fs/length(F);
baxis=(1:N:N*(length(x)/2-1));
plot(baxis,real(F(1:length(F)/2))) 


2 comments:

  1. //Most of the signals in practice, are TIME-DOMAIN signals in their raw format.// Not correct. Time/Frequency are interrelated parameter of a signal and both representations are two views of a same signal. In ideal case, Square waves should consist of infinite frequencies.

    ReplyDelete