Hi, Jacob!<br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><p align="left">As a first step into the wonderful and time consuming world of DSP&lt;=&gt;Chuck I want to make audible the effect of disregarding the sampling theorem. 
</p></div></blockquote><div>Breakin&#39; the law! :¬) <br>Very good!<br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><p align="left">
So all I&#39;m trying to do at the moment is creating a simple down-sampler without any proper filtering. As it is said in the sampling theorem this should not create any distortion as long as my new sampling rate is at least twice as high as the highest sine wave in my input signal.
</p></div></blockquote><div><br>That&#39;s right. As long as you&#39;re sampling at at least twice the frequency of the bandwith of the signal the signal can be completely re-constructed. The easy way yo guarantee that is to chop off a bit of the bandwith with a LPF but you can indeed also make sure the signal fall in that range. So far so good.
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><p align="left">&nbsp;</p>
<p align="left"></p>
<p align="left">By using a common sample-rate like e.g. 44100 Hz in Chuck this should satisfy the sampling theorem. I guess the reason, why I doesn&#39;t get a nice 440-sine wave here is because I have to reconstruct the sine wave after the down sampling with the remaining samples, as the output cannot know that they are part of a proper sine wave. Is this right? If yes, could someone give me a hint how to realize something like this? 
</p></div></blockquote><div><br>Yes, that&#39;s right. The sampling theorem says the signal can be completely recovered, however, it doesn&#39;t say you can &quot;recover&quot; it by simply listening to the values as a train.
<br><br>What&#39;s happening is that you are creating a wave with steps in the amplitude and such steps will have harmonics, some within the range below 22.05KHz, some above. Fortunately this is simple to solve, all you need is a brick-wall lowpass filter with a linear phase response set to cut off at your Nyquist. Unfortunately, those don&#39;t grow on trees.
<br>&nbsp;</div><br>You can try various techniques to approximate one, I&#39;d start by simply chucking my Step into a lowpass filter ( LPF ) and seeing how that affects matters. That&#39;s not going to cure all of your woes but it will greatly decrease them. From there on it&#39;s diminishing returns. I don&#39;t think you will realize true mathematical perfection but with some reading up on DSP you could get close to what most ears stop finding objectionable... Or you might find cases in which you like the artifacts better then the perfection.
<br><br>Happy ChucKing!<br>Kas.<br></div>