Calculating the Fourier Transform of a Digital Signal

Click For Summary
The discussion focuses on calculating the Fourier transform of a digital signal defined as x[n] = 3 for -2 < n < 2, with participants confirming the calculation process and results. The Fourier transform is derived using the summation formula, leading to the expression 3(1 + 2cos(ω) + 2cos(2ω)). A second signal, x[n] = -2n, is introduced, prompting further calculations and simplifications, with participants discussing the correct forms for amplitude and phase characteristics of the Fourier transforms. The conversation also touches on using Excel for sketching the amplitude and phase, emphasizing the importance of understanding the magnitude and phase relationships in signal processing. Overall, the thread provides insights into Fourier transform calculations and their implications in digital signal analysis.
  • #31
OK, the phase of a real-valued function is easy: it's 0 wherever the function is positive, and it's \pi wherever the function is negative. The phase is undefined at any points where the function is 0. Or, alternatively, you can define it to be whatever you like at such points.

Now consider the second problem: in that case, the Fourier transform turned out to be imaginary. What's the phase in that case?
 
Physics news on Phys.org
  • #32
Rite are the plot amplitude and phase characterisitics meant to be on different charts:

For example:
<br /> 3\cdot|1 + 2\cos \omega + 2 \cos 2\omega |<br />
Would give the amplitude.

What u sed above gives the phase characteristics?

Im still a little confused:confused:
 
  • #33
Jamiey1988 said:
Rite are the plot amplitude and phase characterisitics meant to be on different charts:

For example:
<br /> 3\cdot|1 + 2\cos \omega + 2 \cos 2\omega |<br />
Would give the amplitude.

What u sed above gives the phase characteristics?

Im still a little confused:confused:

Well, one way to write a formula for the phase would be to use the "sgn" function:

\mbox{sgn}(x) = \begin{cases}<br /> 1, &amp; \mbox{if }x &gt; 0 \\<br /> 0, &amp; \mbox{if }x = 0\\<br /> -1, &amp; \mbox{if }x &lt; 0<br /> \end{cases}
 
  • #34
By the way, it's probably easier to determine the phase if you use the alternative form which I derived in post #6:

\frac{\sin(2.5 \omega)}{\sin(0.5\omega)}

In this form it's easier to see when the function is positive and when it is negative. It is positive when the numerator and denominator have the same sign, and it is negative when they have opposite signs.

Notice that the period of the denominator is an integer multiple (5) of the period of the numerator. As \omega increases, the numerator runs through exactly five cycles of the sine function for every one cycle in the denominator.
 
  • #35
Ok so using th alternative form I can just sub in values for w from -3pi to pi and from resulting values i can see whether they are positive zero or negative.

And as u sed

positive = 0
negative = pi
zero = undefined
 
Last edited:
  • #36
Ive just noticed I may have made an error. For the Fourier transform mentioned in post 18.
I concluded that:

8i sin2x + 4i sinx

could be written as:

4i (sin2x+sinx)

However I have missed a 2 out from sin2x.

So should it be:

4i (2sin2x + sinx)

marcusl or jbunni does this look correct to u?
 
  • #37
Jamiey1988 said:
Ive just noticed I may have made an error. For the Fourier transform mentioned in post 18.
I concluded that:

8i sin2x + 4i sinx

could be written as:

4i (sin2x+sinx)

However I have missed a 2 out from sin2x.

So should it be:

4i (2sin2x + sinx)

marcusl or jbunni does this look correct to u?

It looks right to me. I hadn't noticed the earlier error you pointed out.
 
  • #38
Thanks Jbunnnii I only just noticed it myself. For the first Fourier transform i sketched the magnitude of the function and it oscillates between 9 and 6.708. From -3pi to 3pi. This seem correct to u??
 
Last edited:
  • #39
Also would the magnitude of:
4i (2sin2x + sinx)
be

SQRT-16 .((2sin2x)^2 + (sinx)^2)

which would give me imaginary numbers so cannot be plotted.
 
  • #40
Jamiey1988 said:
Also would the magnitude of:
4i (2sin2x + sinx)
be

SQRT-16 .((2sin2x)^2 + (sinx)^2)

which would give me imaginary numbers so cannot be plotted.

No, that's not right.

What is the magnitude of 4i? It's 4, not -4.
 
  • #41
Ah i see so the magnitude would be:

4.SQRT((2sin2x)^2 + (sinx)^2)
 
  • #42
Jamiey1988 said:
Ah i see so the magnitude would be:

4.SQRT((2sin2x)^2 + (sinx)^2)

No, you left out a term.

The magnitude is

4 \sqrt{(2 \sin 2x + \sin x)^2}

When you expand the square, you get three terms, not two.

Or, you can simply express it as

4 |2 \sin 2x + \sin x|

which is probably easier to work with if all you want to do is plot it.
 
  • #43
Ok I thought magnitude was fo example:

SQRT((a)^2 +(b)^2) not SQRT (a+b)^2

SO to plot magnitude i must expand the brackets to give me three terms. Could u expand the brackets I am little confused.
 
  • #44
Jamiey1988 said:
Ok I thought magnitude was fo example:

SQRT((a)^2 +(b)^2) not SQRT (a+b)^2

The first form is not true in general, but only if a and b are the lengths of two perpendicular vectors and you want the magnitude of the sum of the vectors. (Think Pythagorean theorem.) For example, if z was a complex number, with real component a and imaginary component b, then

|z| = \sqrt{|z|^2} = \sqrt{|a + bi|^2} = \sqrt{(a + bi)(a - bi)} = \sqrt{a^2 + abi - abi + b^2} = \sqrt{a^2 + b^2}

Notice that the middle two terms, abi and -abi, canceled each other. This happens precisely because a and bi are perpendicular to each other.

But you have a different situation. You have a real number,

2 \sin 2x + \sin x,

and you want its magnitude (absolute value).

In general, if r is a real number, then its absolute value is

|r| = \sqrt{|r|^2} = \sqrt{r^2}

So in your case

|2 \sin 2x + \sin x| = \sqrt{(2 \sin 2x + \sin x)^2}

Now expand the square:

(2 \sin 2x + \sin x)^2 = 4\sin^2 2x + 4 \sin 2x \sin x + \sin^2 x

The middle term is the one you are missing.
 
Last edited:
  • #45
Rite ok I understand now how to calculate magnitude. All I have to do now is sub values form -3pi t0 3pi in order to gain the plot required.

Should I adopt the same technique for:

<br /> <br /> 3\cdot|1 + 2\cos \omega + 2 \cos 2\omega |<br /> <br />
 
  • #46
Jamiey1988 said:
Rite ok I understand now how to calculate magnitude. All I have to do now is sub values form -3pi t0 3pi in order to gain the plot required.

Should I adopt the same technique for:

<br /> <br /> 3\cdot|1 + 2\cos \omega + 2 \cos 2\omega |<br /> <br />

Yes, although as I mentioned before, it might be easier if you use the equivalent form

3 \cdot \left| \frac{\sin(2.5 \omega)}{\sin(0.5 \omega)} \right|
 
  • #47
Ye I will adopt ur equvalent form to plot with. With the magnitude obtained for the second Fourier transform where u expanded the square. Would it be easier to rewrite:

sin^(2) x using the chain rule to obtain 2sin(x)cos(x)

Just as I am using Excel to plot the magnitudes. And would that give:

4sin^(2) 2x = 8sin2xcos2x
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
0
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K