# What is issue in square wave reconstruction?

As shown in attached photo:

What is the reason that the approximate square wave $$x_N (t)$$ at right side is not like the original $$x(t)$$ at left side .?

Is the only reason is that number of coefficients N is very less(in this photo/case N=+_13 )and value of N needs to be raised ?

• that directly arises from the pages coming before that figure, and after that figure. You've got a textbook, read it! And please ask precise question based on your understanding of that textbook; it's really no use we should be replicating the exact content of your textbook here. That just wastes our time, and doesn't give you any extra info you couldn't have gotten from the book in the first time – heck, our means are limited here, the book very likely even explains things better! Apr 1 '20 at 12:43
• Please kindly dont be so judgmental. Plz prevent your self from such unkind practice of discouraging learning. If you are so mean, that you don't want others to learn ,you should better sign out rather using SE for discouraging others who want to learn or help others in learning. This SE forum is not your private property. Thanks
– Man
Apr 1 '20 at 12:49
• I'm sorry if I'm judging your question; I'm not judging you! Anyway, the way content moderation works here is that we users give each other feedback on their posts. In this case, I could have gone with a single downvote (for being underresearched), and a close vote as lacking focus (since you're expecting us to give you a synopsis of the book you're reading). I, instead, chose to encourage you to read your book and ask precise questions, hoping that will help you more than asking point-wise, isolated, underresearched questions. Apr 1 '20 at 12:54
– MBaz
Apr 1 '20 at 14:53
• @Man I agree with MM in sentiment, but not necessarily in tone. I am guessing that you are fairly young and if you are trying to learn DSP on your own that is commendable. There is no doubt that you learn something the best when you figure it out on your own, whether that be from scratch (like I tend to do) or following material and doing the exercises. Being spoonfed should be your last resort, yet that is how you come across. Saying "I'm a slow learner, I need help." is not going to garner much sympathy. Apr 1 '20 at 16:12

Well this goes to show that Fourier series is just approximation that gets more and more correct when you add more harmonics. Take a look at this:

$$\dfrac{4\sin\theta}{\pi}$$ is just first harmonic.

Harmonics are integer multiple of base frequency as you can see: $$\sin3\theta$$, $$\sin5\theta$$ etc. And the more of them you add to the first harmonic the more your final signal will look like a square wave.

The square wave you showed on the left will have infinitely many harmonics, and the one on the right is just a sum of first few.

GIF author Cmglee

• great graphic- where did you get it from? Apr 1 '20 at 13:34
• I got it from here, here. This gif has been circulating the web so I did reverse search just to add it here. Don't remember where I first saw it. Apr 1 '20 at 14:03