# Is this a square wave signal?

i have a decomposition of a square wave signal:

$$y = \frac{4h}{\pi}(\sin(x) + \frac{1}{3}\sin(3x) + \frac{1}{5}\sin(5x) + ...)$$

I computed the fundamental wave and 2 harmonic waves:

$$U_{r0} = 27.5e^{j90.8}$$ $$U_{r1} = 35e^{j63}$$ $$U_{r2} = 38$$

Till here, it is correct. Now i have to show the time function of this square wave and my solution is this one:

$$U_r(t) = 27\sin(628t+86.497) + 35\sin(628\cdot 3t+56) + 38.2\sin(628\cdot 5t)$$

But when i plot with Wolfram Alpha it does not look like a square wave. Just too less harmonics or did i do something wrong?

-
I can't make any sense out of this. What are those huge exponentials doing there? I presume you meant $U_{r0}, \dotsc$? When you have more than one subscript you need to enclose them in curly braces to group them together. The fundamental and the first two harmonics are already there in your first expansion; there's nothing to compute (other than substituting $h$ if you have a value for it). Your last equation isn't a square wave, but a superposition of three sine waves, but with much higher frequency than your original signal. There must be a major misunderstanding or mistake here. – joriki May 18 '11 at 15:43
Sorry, forgot the imaginary number j ! – madmax May 18 '11 at 16:00
It is a resonant circuit, so the higher frequencies. Isn't a square wave a summation of sine waves ? – madmax May 18 '11 at 16:13
Yes, a square wave is a summation of sine waves. But it is a specific summation of sine waves, the one you give at the start. Even though the circuit is resonant, the output should still be at the same frequency as the input-it is really a filter. – Ross Millikan May 18 '11 at 16:22
@madmax: In accordance with Ross Millikan's plot and my calculations, the series $\frac{4}{\pi }\sum_{p=1}^{\infty }\frac{1}{2p-1}\sin (\left( 2p-1\right) t)$ is the trigonometric Fourier series of the periodic odd function $f(t)$ defined in $\left[ -\pi ,\pi \right]$ by $$f(t)=\left\{ \begin{array}{ccc} 1 & \text{if} & 0<t<\pi \\ -1 & \text{if} & -\pi <t<0 \\ 0 & \text{if} & t=0 \\ 0 & \text{if} & t=\pm \pi \text{,}% \end{array}% \right.$$ which is a square wave. – Américo Tavares May 18 '11 at 19:18

If I plot $\sin(x)+\sin(3x)/3+\sin(5x)/5$ I get a pretty nice square wave. In your case the +86.497 and +56 introduce phase shifts, which will ruin the wave. Your leading coefficients are also not in the ratio $1:\frac{1}{3}:\frac{1}{5}$ that they should be. Presumably this came out of your calculation of $U_r0, U_r1, U_r2$, which you don't describe. Note that $e^{90.8}$ is a very large number. Where did that come from?
Added: from your circuit, it appears the output voltage is taken from a divider. So $U_o=\frac{R}{R+j\omega L+\frac{1}{j \omega C}}U_i=\frac{j \omega CR}{j \omega CR-\omega^2 CL+1}U_i$ The fact that the filter ratio depends upon the frequency means that a square wave in will not come out a square wave.
How can $e^{90.8}$ at all appear in any calculation (which even remotely has something to do with the world around us). – Fabian May 18 '11 at 15:54
The calculation of $U_{r0},...$ is correct. I have a solution sheet. But i could not find any example on how to make the function of time out of my $U_{r0},...$. So i tried it my way ;-) But it has to look something like that – madmax May 18 '11 at 16:09
@joriki: I noticed that it was somewhere around $10^{40}$ :-) But looking at the circuit of the OP I doubt that he cares about the ratio of gravity to electromagnetic force... But in the mean time there is an imaginary unit appearing in the exponent. This changes a lot... – Fabian May 18 '11 at 18:16