[PD] band-limited square wave

matthew jones m.jones at signal.qinetiq.com
Mon Mar 8 14:40:55 CET 2004


interesting arguments larry.
But you're definitely wrong....! ;)
how amusing.

> For the next experiment, imagine that you are sampling a non-filtered
> square wave through an ADC. In other words, there is no anti-aliasing
> filter in place. What do you expect the digitized samples to look like in
> this case? Would they not be exactly the same as a square wave constructed
> entirely in the digital domain?

well, this is where aliasing will occur.  aliasing MEANING more than one
analogue signal will give rise to the observed digital signal.  aliasing is
MEANINGLESS if you're already in the digital domain.  it refers to going
from a high bandwidth to a lower bandwidth.

> The reconstruction filters in an DAC are there to remove all analogue
> frequency content above nyquist, without affecting the frequency content
> below nyquist.
> So, yes it would ripple, but not in the right way.

no, this would be in the right way! the ripples are due to filtering out all
above Nyquist as you say, which is what we want...!!!  that IS naturally
bandlimited.

> A bandwith-limited square digital osc sould give the same output as
> ADC'ing a squarly analog square wave. So antialiasing filters are
required.
?? what ?? sorry, don't get u

> And it's not the only way to get aliasing: nonlinearities (waveshaping),
> all kinds of modulation (fm, am,...), and much more.
>Digital sine oscillators and digital filters are bandwith-limited by
nature.(<-AGREED)


> First, set your sampling rate to 44100Hz. Now take a digital sine
> oscillator, say [osc~] in PD and set its frequency to 30000Hz.
> What do you expect to hear from the DAC? A sine wave at 30000Hz, even
> though that frequency is higher than fs/2? No, you will in fact here
> an aliased sine at 14100Hz - do you agree. But wait, we constructed this
> signal entirely  in the digital domain, and yet we have aliasing!

well, in DSP terminology, this isn't aliasing.  of course in the digital
domain you can't synthesise ANYTHING higher than nyquist, it's impossible.
if your own code runs functions that attempt to do that, but end up doing
something else (ie return numbers that represent tones that have the same
reflected frequency as the equivalent aliased signals) then that function is
not producing aliased outputs, but correctly generating frequencies that are
lower than YOU intended.  again, aliasing only applies to going from high
bandwidth to low bandwidth, so if you're sample rate hasn't changed, you're
not getting aliasing.
this is getting pedantic, I can see what you're getting at but at the end of
the day:-

constructing a bunch of numbers in the digital domain cannot produce
'aliased' outputs because the bandwidth has not changed.  reconstruction
will 'perfectly' bandlimit the output (although perfect sinc functions are
impossible) everytime.


Matt

-=-=-=-=-=-=-=-=-=-=-=-=-
http://www.loopit.org/
-=-=-=-=-=-=-=-=-=-=-=-=-





More information about the Pd-list mailing list