C_0 coefficient of Complex Fourier transforms

In summary: The problem seems to be that for ##k \neq 0## there are different ways of writing ##C_k## that are all the same as your expression when ##k## is an integer. For example, when I change the limit of the summation to be ##k \to \infty##, I get the same result as you. This suggests to me that your expression for ##C_k## is correct, but that there is an error in the way that you are computing the ##c_n##s in the series.
  • #1
Wminus
173
29
Mod note: Moved from technical math section, so no template was used.
Hey! So the complex Fourier transform of the square wave

$$
f(x) = \begin{cases}
2 & x \in [0,2] \\
-1 & x \in [2,3] \\
\end{cases}, \space \space f(x+3) = f(x)$$

is ##C_k = \frac{3j}{2 \pi k}( e^{-j \frac{4 \pi k}{3}} -1)##, correct? However, setting ##k = 0## and using L' Hopital rule I get that ##C_0 = 2##, while it should be equal to 1 since that's the average of the function.

Where is the error? My expression for ##C_k## is correct, right?
 
Last edited:
Physics news on Phys.org
  • #2
Wminus said:
Mod note: Moved from technical math section, so no template was used.
Hey! So the complex Fourier transform of the square wave

$$
f(x) = \begin{cases}
2 & x \in [0,2] \\
-1 & x \in [2,3] \\
\end{cases}, \space \space f(x+3) = f(x)$$

is ##C_k = \frac{3j}{2 \pi k}( e^{-j \frac{4 \pi k}{3}} -1)##, correct? However, setting ##k = 0## and using L' Hopital rule I get that ##C_0 = 2##, while it should be equal to 1 since that's the average of the function.

Where is the error? My expression for ##C_k## is correct, right?

Are actually doing the Fourier transform, or do you mean the Fourier series? These are very different things.
 
  • #3
Ray Vickson said:
Are actually doing the Fourier transform, or do you mean the Fourier series? These are very different things.
I'm sorry, I mixed them up. I meant I was finding the the complex Fourier series of ##f(x)## , with the ##C_k##s being its coefficients.
 
  • #4
Wminus said:
I'm sorry, I mixed them up. I meant I was finding the the complex Fourier series of ##f(x)## , with the ##C_k##s being its coefficients.

OK, so to clarify: are you writing the Fourier series as
[tex] f(x) = \sum_{n=-\infty}^{\infty} c_n e^{inax} [/tex]
for an appropriate value of the parameter ##a##? If so, what is your ##a##, and what is the formula you are using to compute the ##c_n##?
 
  • Like
Likes Wminus
  • #5
Ray Vickson said:
OK, so to clarify: are you writing the Fourier series as
[tex] f(x) = \sum_{n=-\infty}^{\infty} c_n e^{inax} [/tex]
for an appropriate value of the parameter ##a##? If so, what is your ##a##, and what is the formula you are using to compute the ##c_n##?

Sorry, it appears my OP was really dang. Yeah, I am using that form and I use equation 3 from here http://www.thefouriertransform.com/series/complexcoefficients.php to calculate the Fourier coefficients. What I don't get is why my C_0 coefficient is twice as large as it's supposed to be..
 
  • #6
Wminus said:
Sorry, it appears my OP was really ****. Yeah, I am using that form and I use equation 3 from here http://www.thefouriertransform.com/series/complexcoefficients.php to calculate the Fourier coefficients. What I don't get is why my C_0 coefficient is twice as large as it's supposed to be..

That's odd: when I do the integral, I get ##c_0 = \frac{1}{3} \int_0^3 f(t) \, dt = 1##, not the value 2 that you claim. I have not checked your other values for ##n \neq 0##.
 
Last edited:
  • Like
Likes Wminus
  • #7
Yes, I get that too. That is the correct value. My problem is that I don't get this result with the expression of the ##C_k## from the OP.

I'll try to explain my problem as best I can:

(1) I got my ##C_k=\frac{3j}{2 \pi k}( e^{-j \frac{4 \pi k}{3}} -1)## from the definition of the complex-fourier series, and that definition states: ##C_k = \frac{1}{T} \int_0^T f(t) e^{-j k \omega t} dt, \space \omega = 2 \pi /T##. This is defined for all ##k \geq 0##, right?

(2) Further, by setting ##k=0##, we get that ##C_0 = \frac{1}{T} \int_0^T f(t) e^{-j k \omega t} dt##, which is ##C_0 =1## in our case.

However, from my earlier expression (1), I have that setting ##k=0## gives ##lim_{k\to0} C_k = lim_{k\to0} \frac{3j}{2 \pi k}( e^{-j \frac{4 \pi k}{3}} -1) = 2 \neq 1##. This isn't what I get in (2), and I fail to understand this discrepancy!
 
  • #8
Wminus said:
Yes, I get that too. That is the correct value. My problem is that I don't get this result with the expression of the ##C_k## from the OP.

I'll try to explain my problem as best I can:

(1) I got my ##C_k=\frac{3j}{2 \pi k}( e^{-j \frac{4 \pi k}{3}} -1)## from the definition of the complex-fourier series, and that definition states: ##C_k = \frac{1}{T} \int_0^T f(t) e^{-j k \omega t} dt, \space \omega = 2 \pi /T##. This is defined for all ##k \geq 0##, right?

(2) Further, by setting ##k=0##, we get that ##C_0 = \frac{1}{T} \int_0^T f(t) e^{-j k \omega t} dt##, which is ##C_0 =1## in our case.

However, from my earlier expression (1), I have that setting ##k=0## gives ##lim_{k\to0} C_k = lim_{k\to0} \frac{3j}{2 \pi k}( e^{-j \frac{4 \pi k}{3}} -1) = 2 \neq 1##. This isn't what I get in (2), and I fail to understand this discrepancy!

The problem seems to be that for ##k \neq 0## there are different ways of writing ##C_k## that are all the same as your expression when ##k## is an integer. For example, when I compute ##C_k## for general ##k > 0## using Maple, I get
[tex] C_k = \frac{i}{2 \pi k} \left( -2 + 3e^{-4 \pi i k/3} - e^{-2 \pi i k} \right) [/tex]
This expression has limit ##\lim_{k \to 0} C_k = 1##, as it should (from continuity of ##e^{- i k 2 \pi/3}##). When ##k## is an integer, it reduces to your previous expression for ##C_k##, but that expression does not apply when ##k## is fractional.
 
  • Like
Likes Wminus
  • #9
Ray Vickson said:
The problem seems to be that for ##k \neq 0## there are different ways of writing ##C_k## that are all the same as your expression when ##k## is an integer. For example, when I compute ##C_k## for general ##k > 0## using Maple, I get
[tex] C_k = \frac{i}{2 \pi k} \left( -2 + 3e^{-4 \pi i k/3} - e^{-2 \pi i k} \right) [/tex]
This expression has limit ##\lim_{k \to 0} C_k = 1##, as it should (from continuity of ##e^{- i k 2 \pi/3}##). When ##k## is an integer, it reduces to your previous expression for ##C_k##, but that expression does not apply when ##k## is fractional.

Kind of interesting how all this weird stuff starts happening when you start dividing by zero... When I derived ##C_k## I made no assumptions what-so-ever, so both mine and your ##C_k## should be mathematically equivalent to ##C_k = \frac{1}{T} \int_0^T f(t) e^{-j k \omega t} dt, \space \omega = 2 \pi /T##. Yet despite this, they produce different answers. Strange.

But at the end of the day L'Hopital's rule is used to evaluate these limits and I've only ever applied it when the variable of differentiation is continuous, while here ##k## is discrete.
 
  • #10
Wminus said:
Kind of interesting how all this weird stuff starts happening when you start dividing by zero... When I derived ##C_k## I made no assumptions what-so-ever, so both mine and your ##C_k## should be mathematically equivalent to ##C_k = \frac{1}{T} \int_0^T f(t) e^{-j k \omega t} dt, \space \omega = 2 \pi /T##. Yet despite this, they produce different answers. Strange.

But at the end of the day L'Hopital's rule is used to evaluate these limits and I've only ever applied it when the variable of differentiation is continuous, while here ##k## is discrete.

Well, my ##C_k## above IS ## \frac{1}{T} \int_0^T f(t) e^{-j \omega k t}\, dt## without any assumptions about ##k##. However, the moment you make ##k## an integer, you can (and often will) make ##e^{-2 \pi i k} = 1## automatically; for example, most (or, at least, many) computer algebra systems will make that simplification right away, and that will be enough to change the limit.

Basically, it amounts to saying that ##C_k = N(k)/k##, and that we can have two different numerator functions ##N_1(k)## and ##N_2(k)## such that ##N_1(k) = N_2(k)## for all integers ##k##, but with different derivatives ##N_i'(k)## at the integer values of ##k##. That will make the limits of ##N_1(k)/k## and ##N_2(k)/k## come out different as ##k \to 0##.
 
  • Like
Likes Wminus
  • #11
Ray Vickson said:
Well, my ##C_k## above IS ## \frac{1}{T} \int_0^T f(t) e^{-j \omega k t}\, dt## without any assumptions about ##k##. However, the moment you make ##k## an integer, you can (and often will) make ##e^{-2 \pi i k} = 1## automatically; for example, most (or, at least, many) computer algebra systems will make that simplification right away, and that will be enough to change the limit.

Basically, it amounts to saying that ##C_k = N(k)/k##, and that we can have two different numerator functions ##N_1(k)## and ##N_2(k)## such that ##N_1(k) = N_2(k)## for all integers ##k##, but with different derivatives ##N_i'(k)## at the integer values of ##k##. That will make the limits of ##N_1(k)/k## and ##N_2(k)/k## come out different as ##k \to 0##.
Ah yes, you're right. I think I also set ##e^{-2 \pi i k} = 1## in my calculations, unwittingly making the mathematical assumption that the ##k##s are integers, and thus changed the limit that comes from L'Hopital. I didn't realize the assumption I made because I thought it was a given that the ##k##s are integers, but just looking at the definition of ##C_k## I see it wasn't.

Thanks man, I really appreciate that you cleared this up for me. :)
 

1. What is the C_0 coefficient of Complex Fourier transforms?

The C_0 coefficient, also known as the DC coefficient, is the constant term in a Complex Fourier transform. It represents the average value of the signal or function being transformed.

2. How is the C_0 coefficient calculated?

The C_0 coefficient is calculated by taking the integral of the original signal or function over one period and dividing it by the length of the period. This value is then multiplied by 2π to get the final coefficient.

3. What is the significance of the C_0 coefficient?

The C_0 coefficient is important because it provides information about the overall level or offset of the signal or function. It also helps to determine the amplitude of the other coefficients in the Fourier transform.

4. Can the C_0 coefficient be negative?

Yes, the C_0 coefficient can be negative if the signal or function being transformed has a net negative value over one period. This can happen with asymmetric or non-symmetric signals.

5. How does the C_0 coefficient affect the frequency spectrum?

The C_0 coefficient does not affect the frequency spectrum directly, but it can impact the overall shape of the spectrum by shifting it up or down depending on its value. It also affects the amplitude of the other coefficients in the Fourier transform.

Similar threads

  • Calculus and Beyond Homework Help
Replies
5
Views
355
  • Calculus and Beyond Homework Help
Replies
3
Views
284
  • Calculus and Beyond Homework Help
Replies
16
Views
564
  • Calculus and Beyond Homework Help
Replies
1
Views
343
  • Calculus and Beyond Homework Help
Replies
7
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
364
  • Calculus and Beyond Homework Help
Replies
1
Views
535
  • Calculus and Beyond Homework Help
Replies
3
Views
416
  • Calculus and Beyond Homework Help
Replies
1
Views
988
  • Calculus and Beyond Homework Help
Replies
1
Views
215
Back
Top