Question relating to Nyquist frequency

Customising, building or repairing your own gear? Need help with acoustic treatment or soundproofing? Ask away…

Re: Question relating to Nyquist frequency

Ah now! A sort of passing comment in my new ampliers book by D.Self (you might see a few of these extracts!) he states that the ringing seen on square waves in amplifier reviews are NOT as often stated, a shortcoming of the PA design but more, as Hugh has pointed out, inevitable when square waves are so used.

Not put that quite correctly but will find the exact wording.

Dave.
ef37a
Jedi Poster
Posts: 10867
Joined: Mon May 29, 2006 12:00 am
Location: northampton uk

Re: Question relating to Nyquist frequency

ef37a wrote:...the ringing seen on square waves in amplifier reviews are NOT as often stated, a shortcoming of the PA design but more, as Hugh has pointed out, inevitable when square waves are so used.

The Fourier analysis of a square wave states that it is comprised of an infinite series of odd harmonics of its fundamental frequency, each with a slightly lower amplitude than the previous one in a specific ratio:

So... if you pass that perfect square wave through any kind of band-limited system, some of the highest harmonic elements will be removed and others strongly attenuated.

It is the removal of these harmonics that result in the square wave developing the apparent 'ringing' artefacts.

As an alternative viewpoint, consider the shape of the waveform as you build up a square wave from a series of harmonic sinewaves, starting with the fundamental, then the first, third, fifth, seventh harmonics and so on.... you'll see that with only a few harmonics present, the squarewave appears to have a lot of ripples (or ringing) on its flat sections, but as more and more harmonics are added the top and bottom of the squarewave become flatter and flatter (with less and less apparent ringing).

Om other words, you need a system with an infinite bandwidth to represent a perfect square wave. Anything less will reproduce a squarewave with ripples (ringing), and the narrower the bandwidth the more pronounced those ripples will be.

And while true ringing after an impulse edge may indicate an unstable system, the presence of ripples on a square wave is more likely to indicate a band-limited system.

https://archive.cnx.org/contents/72f90f3a-f72c-4459-b439-1d27bf9d14d2@1/fourier-series-square-wave

H

Hugh Robjohns
Moderator
Posts: 25032
Joined: Fri Jul 25, 2003 12:00 am
Location: Worcestershire, UK
Technical Editor, Sound On Sound

Re: Question relating to Nyquist frequency

Hey all,

What this means is that, yes, you can derive the frequency of a wave at more than twice the sampling rate. But NOT the shape of the wave. Everything (when using 44Khz) is a sine at 20Khz, it doesnt matter what it was originally. A pulse becomes a sine at 20Khz, a triangle also becomes a sine. In fact at 10Khz this effect is already really pronounced. So 44Khz and this whole way of sampling we're doing is flawed as hell!

So for more accurate reproduction the sample rate needs to go up and I'd think there needs to be a smarter instruction set that can deal with (almost) straight lines
and corners (to try and make true pulses and triangles).

To summarize, a wave has a frequency and a shape. At 44Khz, you can capture the frequency of a wave at 20Khz, but not the shape (everything becomes a sine). This means this 44Khz 16Bit format that we're using is substantially flawed. Its really far away from a 'perfect' reproduction.

p
Peter Kriek
Posts: 1
Joined: Sat Nov 09, 2019 7:28 am

Re: Question relating to Nyquist frequency

Peter Kriek wrote:Hey all,

What this means is that, yes, you can derive the frequency of a wave at more than twice the sampling rate. But NOT the shape of the wave. Everything (when using 44Khz) is a sine at 20Khz, it doesnt matter what it was originally. A pulse becomes a sine at 20Khz, a triangle also becomes a sine. In fact at 10Khz this effect is already really pronounced. So 44Khz and this whole way of sampling we're doing is flawed as hell!

So for more accurate reproduction the sample rate needs to go up and I'd think there needs to be a smarter instruction set that can deal with (almost) straight lines
and corners (to try and make true pulses and triangles).

To summarize, a wave has a frequency and a shape. At 44Khz, you can capture the frequency of a wave at 20Khz, but not the shape (everything becomes a sine). This means this 44Khz 16Bit format that we're using is substantially flawed. Its really far away from a 'perfect' reproduction.

p

It's fine for the reproduction of music. Don't forget the human ear is at best limited to a bit over 20kHz, and generally a lower frequency than that for any but the very young. So sampling at greater than 44kHz doesn't add anything to the frequencies we hear, as the physical limitations of the human ear will filter out any higher frequencies. Plus the audio reproduction systems we use - monitors and headphones - also have physical limits as to the frequencies they can reproduce, which is generally not a lot above 20kHz. OK, some ribbon tweeters used can rise as high as 40kHz, but in general, that will only add one or two more harmonics compared to a 20kHz tweeter, and in an infinite summing series, that's not a lot.

And a 20kHz triangle does not become a sine at 44kHz sampling. At 40kHz, yes, but not 44kHz. 40kHz is not the Nyquist frequency for 20kHz. Because the Nyquist sampling rate has to be greater than 2x the sampled note frequency, you aren't just sampling at peak and nadir (or always at the same two points on the waveform), but at different points along the waveform as time progresses, so a D/A converter can successfully reproduce the original waveform, given more than just a few samples.

Wonks
Jedi Poster
Posts: 10140
Joined: Thu May 29, 2003 12:00 am
Correcting mistakes on the internet since 1853

Re: Question relating to Nyquist frequency

Peter Kriek wrote:... this whole way of sampling we're doing is flawed as hell!

Er... No! :lolno:

The only thing that's 'flawed as hell' is your understanding of the Nyquist sampling theory and its inherent requirement for use within a band-limited system.

By being band-limited, a signal close to half the sample rate can only be a sine wave -- by definition -- because only the fundamental is retained and it can no longer contain any harmonic components. Therefore the sampling system captures the entire band-limited signal -- both its frequency and shape -- perfectly accurately.

In suggesting that the 'shape' of a 20kHz (fundamental) signal -- be it triangular, square, pulse or whatever -- is important to the audible sound, you are implying that you can perceive harmonic content at 40kHz and far above.... And also that the microphones, analogue electronics and loudspeakers can all capture and reproduce those ultrasonic components accurately... Which is patently nonsense.

Hugh Robjohns
Moderator
Posts: 25032
Joined: Fri Jul 25, 2003 12:00 am
Location: Worcestershire, UK
Technical Editor, Sound On Sound

Re: Question relating to Nyquist frequency

Peter Kriek wrote:
... this 44Khz 16Bit format that we're using is substantially flawed. Its really far away from a 'perfect' reproduction...

Yes, if you're a bat...
Tim Gillett
Frequent Poster
Posts: 1888
Joined: Wed Jan 30, 2013 1:00 am
Location: Perth, Western Australia

Re: Question relating to Nyquist frequency

Or a dolphin...

Humble Bee
Regular
Posts: 283
Joined: Mon Jan 08, 2007 1:00 am
Location: Switzerland/Germany/Sweden

Re: Question relating to Nyquist frequency

Nah, bats 200kHz, dolphins only 160 kHz.

Bats rule!
Tim Gillett
Frequent Poster
Posts: 1888
Joined: Wed Jan 30, 2013 1:00 am
Location: Perth, Western Australia

Re: Question relating to Nyquist frequency

Tim Gillett wrote:Nah, bats 200kHz, dolphins only 160 kHz.

Bats rule!
So they were were illegally receiving Droitwich in the days of the domestic radio license.
Who knew? :lol:

Folderol
Jedi Poster
Posts: 9183
Joined: Sat Nov 15, 2008 1:00 am
Location: The Mudway Towns, UK
Yes. I am that Linux nut.
Onwards and... err... sideways!

Re: Question relating to Nyquist frequency

Humble Bee wrote:Or a dolphin...

Maybe Bowie meant to write 'hear' instead of 'swim' in 'Heroes'.

Wonks
Jedi Poster
Posts: 10140
Joined: Thu May 29, 2003 12:00 am
Correcting mistakes on the internet since 1853

Re: Question relating to Nyquist frequency

Folderol wrote:
Tim Gillett wrote:Nah, bats 200kHz, dolphins only 160 kHz.

Bats rule!
So they were were illegally receiving Droitwich in the days of the domestic radio license.
Who knew? :lol:

Yes definitely tax dodging freeloaders. But only young bats could hear the programmes as it was at their extreme upper frequency limit. The older bats couldn't understand what all the fuss was about...
Tim Gillett
Frequent Poster
Posts: 1888
Joined: Wed Jan 30, 2013 1:00 am
Location: Perth, Western Australia

Re: Question relating to Nyquist frequency

:bouncy:

Cetaceous and chiroptereous amusements aside, it's enormously concerning (to me at least), that well established music artists like Peter Kriek (although he is far from alone in this regard) -- who inherently have significant influence over their followers -- state their gross technical misunderstandings as scientific fact. :frown: And these kinds of nonsense myths always seem to spread far quicker than the truth...

Hugh Robjohns
Moderator
Posts: 25032
Joined: Fri Jul 25, 2003 12:00 am
Location: Worcestershire, UK
Technical Editor, Sound On Sound

Re: Question relating to Nyquist frequency

True but some record companies don't always set a good example on this either with their now up to 192/24 releases. There's a promo for a historic Callas box set which tells us in all seriousness, or at least strongly implies how much better these old recordings now sound in HD compared to poor old CD quality. But listen how the promo only plays excerpts that were originally well captured and so also sounded fine on CD. The originally seriously distorted forte sections we don't get to sample...
Tim Gillett
Frequent Poster
Posts: 1888
Joined: Wed Jan 30, 2013 1:00 am
Location: Perth, Western Australia

Re: Question relating to Nyquist frequency

I've found this thread interesting. I'm surprised that aliasing hasn't come up, which is the reason that the input has to be band-limited, or filtered in less technical speak.

Much as making fun of audiophiles is amusing you don't have to be a bat to hear filter artefacts in the passband. One legitimate reason for a higher sampling rate is nothing to do with our perception of ultrasonic frequencies. It's to make the design of the anti-aliasing filter easier, cheaper and with less likelihood of it affecting the passband.

Folderol wrote:For example, I have a KA6 here that performs very well, however hit it with a really clean square wave from a signal generator and the ringing is quite obvious..

This interested me. Did you hear ringing or did you see it on a scope? I fed my soundcard a square wave and got this :

I'm not sure I heard it as I don't have an easy way of listening to it without going through the computer at the moment.
merlyn
Poster
Posts: 21
Joined: Thu Nov 07, 2019 3:15 am

Re: Question relating to Nyquist frequency

merlyn wrote:One legitimate reason for a higher sampling rate is nothing to do with our perception of ultrasonic frequencies. It's to make the design of the anti-aliasing filter easier, cheaper and with less likelihood of it affecting the passband.

Fair point -- although the benefit of double sample rates is not so much about making the filter design easier as accommodating the inherent flaws in standard filter designs.

It's certainly true that typical 'half-band' filters operating at base sample rates have the potential to introduce aliasing, although these unwanted artefacts usually only become apparent when recording very high levels with very strong harmonics or HF content.... Which is not that common a situation, to be fair.

Did you hear ringing or did you see it on a scope?

I believe he was talking about seeing it on a scope. There really isn't anything to hear. As explained earlier, it is a natural and benign side-effect of some very high order and inherently inaudible harmonics being removed.

But it's worth noting that this is a different kind of 'ringing' to the often memtioned pre- and post-ringing associated with the linear phase filter's impulse response.

Hugh Robjohns
Moderator
Posts: 25032
Joined: Fri Jul 25, 2003 12:00 am
Location: Worcestershire, UK
Technical Editor, Sound On Sound

Previous

Who is online

Users browsing this forum: No registered users