signal processing - conversion to fourier domain - examples
- Details
- Last Updated: Sunday, 06 October 2019 15:21
- Published: Monday, 23 September 2019 18:03
- Hits: 3104
Examples of few common signals in Fourier domain:
When we transform signals from time domain to frequency domain, it's just like any other transformation in maths. A function takes inputs, and transforms it. If there is 1:1 transformation, then we can recover the original input, by applying inverse function to output. However, one thing that stands out in conversion from time domain to frequency domain is that frequency domain bears resemblance to physics. It's easier to visualize sound waves in terms of frequency, so most of the examples about fourier conversion talk about sound waves, but fourier conversion can be applied to any data.
This link shows proof of FT of some common functions: http://www.thefouriertransform.com/pairs/fourier.php
Let's intuitively try some conversion from time domain to freq domain for the below waveforms for all 4 fourier domains: CTFS, CTFT, DTFS, DTFT. Then we'll do rigorous calculation to verify it:
1. Constant signal: This is a signal which is a constant value for all times (-∞ < t < ∞). Since this signal has no variation at all, we don't expect to have any sine/cosine waveforms to reconstruct this dc signal. Infact just the DC offset would be enough to construct this signal. So, in frequency spectrum, we don't expect to see any freq component except f=0 (DC signal).
CTFS: We assume signal to be periodic with arbitrary period T0. We can do this since an infinite long constant signal can be broken into finite duration signals.
Ck = 1/T0 ∫ x(t) e-jω0kt dt = 1/T0 ∫ 1 * e-jω0kt dt = 1/T0 [e-jω0kt ] /(-jω0k) with limits = +T0/2 to -T0/2. For all non zero values of k, Ck = 0. For k=0, we do not integrate (since integration not possible with k in denominator), instead we do C0 = 1/T0 ∫ 1 * dt = 1.
So, only at f=0, we get C0 = 1, all other freq components are 0 as expected.
CTFT: Since for CTFT, signal can be aperiodic, we can compute CTFT of dc signal directly
X(ω) = ∫ x(t) e-jωt dt = ∫ 1 * e-jωt dt = [e-jωt ] /(-jω) with limits of t = +∞ to -∞. However, this doesn't converge to any value, as e-jωt = cos(ωt) - j.sin(ωt) = which oscillates as t->∞. So, we guess that the answer is delta function. If that is true, then x(t) = 1/(2Π) ∫ X(ω) ejωt dω = 1/(2Π) ∫ δ(ω) ejωt dω = 1/(2Π). That implies that X(ω) = (2Π) δ(ω).
Here again, we see that for constant function, freq component exists only at ω=0, with magnitude=2Π
DTFS: If we take discrete samples of constant signal, then we get a signal which is 1 at all samples. Again, treating the signal as periodic with period T0, with N samples in that period, we can compute DTFS.
x[n]=1 for n=0 to N-1.
Ck = 1/N ∑ x[n] e-j(2Π/N)kn = 1/N ∑ 1 * e-j(2Π/N)kn for n=0 to N-1.
Now, we can calc exponential sum formula ∑ ejkn for n=0 to n=N-1. This is same as sum of geometric series = (1 - ejkN) / (1 - ejk) = sin(1/2*N*k)/sin(1/2*k) * ejk(N-1)/2
So, Ck = 1/N ∑ 1 * e-j(2Π/N)kn = 1/N * (1 - e-j(2Π/N)kN) / (1 - e-j(2Π/N)k) = 1/N * (1 - e-j(2Π)k) / (1 - e-j(2Π/N)k)
For k=0, Ck = C0 = 1/N * ∑ 1 * 1 = 1/N * N =1
For k≠0, Ck = 1/N * (1 - e-j(2Π)k) / (1 - e-j(2Π/N)k) = 1/N * (1 - 1) / (1 - e-j(2Π/N)k) = 0
Here, just as in CTFS, only at f=0, we get C0 = 1, all other freq components are 0 as expected.
DTFT: Here, again we have discrete samples, but signal is considered aperiodic. So, we can compute DTFT directly.
x[n]=1 for n=-∞ < n < ∞.
X(ejω) = ∑ x[n] e-jωn = ∑ 1* e-jωn = with limits of t = +∞ to -∞. However, this doesn't converge to any value, for same reasons as CTFT. So, we guess answer as δ(ejω)
=> x[n] = 1/(2Π) ∫ X(ejω) ejωn dω = 1/(2Π) ∫ δ(ω) ejωn dω = 1/(2Π). That implies that X(ejω) = (2Π) δ(ejω).
So, as expected, freq component exists only at ω=0, with magnitude=2Π
DFT: DFT is same as DTFS. We can compute DFT by taking N samples of DTFT
DFT Xk or X[k] = samples of X(Ω) at discrete freq = X(Ω) | ω=2Πk/N where 0 <= k <= N-1.
Since X(ejω) = (2Π) δ(ejω) => X0 = (2Π), X1 to XN-1 = 0 as delta function is 0 everywhere else. Result is same as DTFS, except for factor of (2Π) .
2. Impulse signal: It's denoted by δ(t). This is a signal which has a finite value at t=0, but is 0 everywhere else. For analog signals, it's impossible to construct such a signal (since analog signals need to go from 0->1 and then back from 1->0, which will always take a finite amount of time), but mathematically in the limit t->0, we can approximate such a signal. For discrete signal, such a signal is possible to construct by having sample at t=0 as "1", and "0" everywhere else. It's hard to visualize what freq components such a signal would have. But, we do observe that impulse func is an infinitely steep signal in limiting case where t->0. So, it should have infinite freq component in it. It should also have a DC freq component in it, as it's avg value is "1", and not "0". It turns out that such an impulse signal has all freq components from 0 to ∞, of equal magnitude. We can derive this by employing duality property of FT, where taking fourier of frq domain func, gives time domain function back. So, if we have constant signal in time domain, we get impulse func in freq domain, as we saw above. So, constant signal in freq domain will give impulse signal in time domain. That is how we get constant function in freq domain by using duality theorem.
3. train of impulses: It can be rep as periodic impulse func.
4. Sine/Cosine wave: This is a sine/cosine wave with a given freq. It may have a net dc value depending on whether the waveform is shifted up/down from y=0. If it has a net dc value, the only difference in freq spectrun would be that it would have a dc component (f=0) in it's freq spectrum.
A. periodic:
CTFS: It will have only 1 freq component at the freq of sine wave itself. So, Ck will be non zero only at that freq (all others will be 0). This can be seen intuitively as FS is summation of sine/cosine, and this waveform is exactly same as one of the terms, so no other terms of sine/cosine needed to make up this waveform. It also has dc freq component (at f=0) if the square signal has net +ve avg value.
CTFT: We can compute CTFT for any func, periodic or aperiodic. So, we compute CTFT for this signal, and expect to get same result as CTFS. However, as we explained in signal processing page, CTFT is an integral, and hence continuous. So, we'll get impulse function at each of the freq component instead of getting a single discrete line, as we get in CTFS.
B. non periodic: DTFT computed. It will be cont freq spectrum, with freq component similar to DTFS. However, now it's an impulse function centered at ω=+ωk and ω=-ωk.
For x(t)=sin(ω0t) => X(ω) = (2Π)/i * 1/2 * [δ(ω-ω0) - δ(ω+ω0)] => 2 soln are +Π/i and -Π/i at ω=ω0 and ω=-ω0
For x(t)=cos(ω0t) => X(ω) = (2Π) * 1/2 * [δ(ω-ω0) + δ(ω+ω0)] => 2 soln are +Π and +Π at ω=ω0 and ω=-ω0
3. Step signal: This is a step signal, going from 0 to 1 at certain time t.
4. square signal: This signal can have any duty cycle. It's 1 for a while, and 0 elsewhere. It can be thought of as a +ve step signal followed by -ve step signal.
A. periodic: For periodic sqaure wave, we have CTFS, which has freq component at freq=1/T, 3/T, 5/T (i.e odd harmonics). It also has dc freq component (at f=0), if the square signal has net +ve avg value. F
B. non-periodic: For non-periodic square wave, we calc CTFT, which turns out to be a sinc func, where sinc func is defined as sinc(t) = sin(Πt)/(Πt)
5. rectangular signal:
6.
Matlab: We can use Matlab software to plot these functions. We use fourier function to calc FT for any function. There is no func for giving FS of periodic func. Instead, we have to solve the series for FS, and have the result plotted. FT is easier to calc using in built "fourier" func, and it can be done for both periodic and aperiodic signals.
Matlab code for plotting the CTFT is:
syms x;
f = exp(-2*x^2); %this is the func whose FT we want. We'll replace this func with our desired func below.
FT = fourier(f); %calculates FT(w) for given f(x). FT is calculated in terms of radians (w)
ezplot(FT,[-1000,+1000]); %plots FT(w) over -1000 rad to +1000rad. By default, it plots from -2Π to +2Π rad
1. Unit Impulse (aka Dirac delta): use f=dirac(x) => gives o/p=1, i.e a dc plot with value=1 at all x.
2. Sine wave: use f=sin(2*pi*x); => gives o/p as Π(-i)(dirac(w-2Π) - dirac(w+2Π)), since dirac func is infinite at +2Π and -2Π and 0 elsewhere, we just see 0 everywhere
3. Cosine wave: use f=cos(2*pi*x); => gives o/p as Π(dirac(w-2Π) + dirac(w+2Π)), again we just see 0 everywhere
2. Square signal: use f = rectangularPulse(a,b,x). Here a=starting of high pulse, b=end of high pulse. By default, if no a or b provided, i.e rectangularPulse(x), then a=-1/2, b=+1/2
syms x;
f=dirac(x);
FT = fourier(f);
ezplot(FT,[-1000,+1000]);