Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER General Discussion Forum

Reply
 
Thread Tools Display Modes
Old 01-20-2015, 09:10 PM   #1
insub
Human being with feelings
 
insub's Avatar
 
Join Date: Mar 2014
Location: Louisville, KY, USA
Posts: 1,075
Default Nyquist Frequency...Why does this matter?

I've seen this term pop up a few times in the forum and it is also mentioned as a selling point for some plugins especially EQs. Since I'd never heard of it I did some research. And, after reading a couple of white papers and whatnot my very basic understanding of the subject makes me wonder...Why does this topic matter? Hopefully some of you more educated people can clue me in on this.

The following is my lay man's interpretation. Feel free to tear it apart and set me straight:

The Nyquist Frequency is half the sample rate. So, assuming that one is recording at 44.1 kHz that would make the Nyquist Frequency 22.05 kHz (higher than the normal range of human perception) for said sampling rate. Digital sampling requires double the sampling rate than the intended source signal so that it can make a duplicate for checks and balances. This duplicate occurs on the opposite side of the Nyquist Frequency. Aliasing occurs when you try to sample a frequency greater than the Nyquist. e.g. you record a sine wave of 30 kHz which would cause an alias of equal amplitude at approximately 16 kHz (equidistant from the Nyquist Frequency). This is bad because the alias is now within the range of human perception. Of course the same occurs when recording frequencies below the Nyquist, but they don't matter because: 1. The aliases are ultrasonic. & 2. That data is not reproduced?

Ok, well if all that is true and correct (probably not, poor memory/understanding) I still don't understand why it matters. It seems to me that the Nyquist Frequency is only of importance to A/D converter design (should probably filter out ultrasonic frequencies prior to conversion) and signal sources (e.g. synthesizers and noise generating plugins should not generate ultrasonic frequencies).

What I mean is...if you look at the frequency response of most microphones they are not capable of recording ultrasonic frequencies. Furthermore, the source you are recording has to be capable of generating ultrasound. I don't think that most, if not all, acoustical instruments and speakers for audio playback/instrument amplifiers are mechanically capable of ultrasound. My hi-fi tower speakers can barely reproduce 17.3 kHz.

What about harmonics/resonance you say? Well maybe they go into the ultrasonic range, but still there is the amplitude to consider. If the amplitude of the harmonics is below the noise floor or below the threshold of human hearing then so too will the alias be. So, we need an ultrasonic source, a way of recording said frequencies, and for those frequencies to be of large enough amplitude that their aliases become audible in the range of human hearing. Oh, and an A/D converter that doesn't filter ultrasonics out prior to conversion. When does all this actually take place? Maybe if you are recording a jet engine with some type of super microphone with a response well above 22 kHz?

Also, how does this matter for an EQ plugin? Once it has been converted to digital when is more ultrasonic content going to be generated to incur more aliasing? Hasn't all the aliasing that's going to occur already happened unless you add distortion or some other plugin that adds to the harmonic/other content above the Nyquist (which hopefully they are designed not to)? Doesn't recording at higher than 44.1/48 kHz make this a moot point since the Nyquist Frequency for 96 kHZ is 48 kHz which is more than double the human hearing spectrum, so no appreciable aliasing can occur?

Sorry, for this extensive post, but this topic has had my brain swimming in a cyclone for weeks trying to get a grip on the idea of the Nyquist Frequency.
__________________
Everything you need to know about samplerates and oversampling... maybe!
My Essential FREE 64bit VST Effects, ReaEQ Presets for Instruments
Windows 10 64 bit; MOTU 828 MKII, Audio Express, & 8PRE; Behringer ADA8000
insub is offline   Reply With Quote
Old 01-20-2015, 10:07 PM   #2
Fergler
Human being with feelings
 
Fergler's Avatar
 
Join Date: Jan 2014
Posts: 5,205
Default

Interested too, for example the big deal made over how an EQ curve shape is altered as it approaches the nyquist frequency - couldn't care less, but supposedly it's important. I would love to be swayed.
Fergler is offline   Reply With Quote
Old 01-20-2015, 10:35 PM   #3
DVDdoug
Human being with feelings
 
Join Date: Jul 2010
Location: Silicon Valley, CA
Posts: 2,779
Default

Quote:
I still don't understand why it matters. It seems to me that the Nyquist Frequency is only of importance to A/D converter design (should probably filter out ultrasonic frequencies prior to conversion)
Right!!! The ADC MUST filter-out frequencies above Nyquist.

To the user, it's only important to know you are limited to Nyquist... It could be especially important if you are using an 8kHz sample rate for telephone use so you won't be surprised when the high frequencies are gone.

Besides A/D, you also MUST low-pass filter when you downsample. That's the job of the developer who writes the resampling algorithm.

Quote:
and signal sources (e.g. synthesizers and noise generating plugins should not generate ultrasonic frequencies).
Nothing on the input or analog side needs to be filtered. If your synthesizer's analog output has ultrasonic frequencies, the filter built-into your ADC will filter them out.

Anything done digitally has to comply with the Nyquist "rule".

Quote:
Digital sampling requires double the sampling rate than the intended source signal so that it can make a duplicate for checks and balances
No, it's not a "duplicate". You simply need to sample the positive and negative half of the waveform... For example, a 1kHz sine wave has 1000 full-cycles every second... The waveform goes positive, then comes-down, crosses-through zero and goes negative, then comes-up through zero again.

Every "wave" has a positive-half and a negative-half, and it crosses through zero twice per cycle. You need to sample the positive-half at least once, and the negative-half at least once. That means you need to sample a 1khz signal at 2kHz or more (two sample per cycle minimum). At sample rates below that, you'll "miss" some half-cycles and.... aliasing when you "connect the dots" to re-construct the waveform!

Quote:
Also, how does this matter for an EQ plugin?
It shouldn't. If for some reason the EQ works better at higher sample rates, the DSP programmer should upsample, apply the effect, then downsample back to whatever the host program is set at. All of this can be done "behind the scenes" and should be of little concern to the user.
DVDdoug is offline   Reply With Quote
Old 01-21-2015, 01:01 AM   #4
timlloyd
Human being with feelings
 
Join Date: Mar 2010
Posts: 4,713
Default

Quote:
Originally Posted by DVDdoug View Post
No, it's not a "duplicate".
He's talking about 'images' -- the upper and lower sidebands that are unavoidable because sampling is amplitude modulation, so creates sum and difference frequencies. If the lower sideband (difference frequencies) overlaps with the frequency range that's being captured, we call it 'aliasing'. The prevention of this overlap is another way of thinking about why a signal must be sampled at least slightly faster than twice for the highest frequency in the signal.

Quote:
It shouldn't. If for some reason the EQ works better at higher sample rates, the DSP programmer should upsample, apply the effect, then downsample back to whatever the host program is set at.
Not necessarily. If the programmer wants the EQ to remain 0-latency (cannot then use a linear phase SRC), but doesn't want the issues that using a minimum-phase filter in the SRC will create, the decramping must be done in a different way. And it can be, without up sampling.

So to the OP, for EQs that do not involve saturation (which would be prone to aliasing), this is relevant for some EQs because their magnitude and phase response will tend towards 0 at the Nyquist frequency. This causes their shape to become progressively narrower and more asymmetric as centre frequency increases. Fixing this with up sampling will either result in latency (linear phase SRC) or further frequency and phase distortion around the Nyquist frequency (minimum phase SRC). If it's fixed by decramping in a different way (e.g. using 'Orphanidis' filters) then the magnitude response will 'enter' the Nyquist frequency horizontally, preventing most of the asymmetry. However, the phase response will still tend towards 0. I am not aware of any evidence for whether or not this is audible in an EQ, though AFAIK it isn't, based on other evidence of the audibility of phase shift.

Last edited by timlloyd; 01-21-2015 at 01:27 AM.
timlloyd is offline   Reply With Quote
Old 01-21-2015, 05:43 AM   #5
insub
Human being with feelings
 
insub's Avatar
 
Join Date: Mar 2014
Location: Louisville, KY, USA
Posts: 1,075
Default

Thanks for your responses!
In this link Indiana University claims that a sampling rate of more than 40 kHz should not cause aliasing.
Columbia University explains aliasing a little better and the need for filters. And, they have some example sound files.

@Tim: My question regarding frequency and phase distortion around the Nyquist frequency is: How close to the Nyquist? I mean @44.1 kHz the Nyquist frequency is 2100 Hz above what is considered the upper limit of human hearing. Of any audio file that I've seen, very little information is recorded near the Nyquist. In any case, if these distortions are occurring in the top most 2000 Hz then they would most likely be beyond the capability of most playback systems, and outside the boundaries of most human perception even if they are of sufficient amplitude. Perhaps some EQs are deteriorating much lower than 2000 Hz below the Nyquist? I don't know, but I don't see why they would.

I've heard people claim that ReaEQ doesn't handle well near the Nyquist. Who the hell is boosting frequencies near the Nyquist in the first place??? Even so, if adding a high shelf boost do we need to consider a low pass filter near the Nyquist to deal with deficiencies in response near the Nyquist? I doubt it. Mainly for the points of my last paragraph.
__________________
Everything you need to know about samplerates and oversampling... maybe!
My Essential FREE 64bit VST Effects, ReaEQ Presets for Instruments
Windows 10 64 bit; MOTU 828 MKII, Audio Express, & 8PRE; Behringer ADA8000
insub is offline   Reply With Quote
Old 01-21-2015, 06:38 AM   #6
insub
Human being with feelings
 
insub's Avatar
 
Join Date: Mar 2014
Location: Louisville, KY, USA
Posts: 1,075
Default

Dan Lavry explains why any sample rate over 60 kHz is overkill for audio. He also has many graphs which portray the accuracy of digital sampling even at 44.1 kHz and the effect of anti-aliasing filters.

So ultimately, this topic seems to be only of importance to AD/DA converter designs and virtual instrument/effects plugins designers.

I still have seen no evidence in substantiating claims that ReaEQ or any other plugin cause audible artifacts that have anything to do with approaching the Nyquist Frequency. Especially, considering the fact that ReaEQ is supposed to be a non-coloring EQ, how will it generate any frequencies at all? It is only supposed to increase or decrease the frequencies that already exist. Not introduce new ones like saturation/distortion plugins do.
__________________
Everything you need to know about samplerates and oversampling... maybe!
My Essential FREE 64bit VST Effects, ReaEQ Presets for Instruments
Windows 10 64 bit; MOTU 828 MKII, Audio Express, & 8PRE; Behringer ADA8000
insub is offline   Reply With Quote
Old 01-21-2015, 07:39 AM   #7
Serenitynow
Human being with feelings
 
Serenitynow's Avatar
 
Join Date: Sep 2010
Posts: 603
Default

So, isn't it more than just what frequencies we can here? Meaning the hz/khz can sound completely different if a piano and a sax play the same note/frequency. Isn't the smoothness and quality of reproduced tone of the sound enhanced by a higher freq. rate? Doesn't it smooth out the "digital steps"?

Rip me a new one if I have it all wrong!
__________________
John
Serenitynow is offline   Reply With Quote
Old 01-21-2015, 08:46 AM   #8
insub
Human being with feelings
 
insub's Avatar
 
Join Date: Mar 2014
Location: Louisville, KY, USA
Posts: 1,075
Default

According to Dan Lavry, and I must say his argument is quite convincing, the answer is no. Look at page 25 where even a 1 kHz square wave is rather complex and it is reproduced exceptionally well at 44.1 kHz sample rate. He does show an advantage to using higher sample rates, but that anything over 60 kHz sample rate has no further advantage and actually the cons start to outweigh the advantages especially by the time you get up to a 192 kHz sample rate. Either way, your AD analog anti aliasing filter is likely to still be set at 20 kHz regardless what sample rate you set your interface to. Generally the higher sample rates just use a different divisor of the same ADC crystal for lower rates which operates in the MHz range. That's why you get an option for doubles in sample rates. One crystal for 44.1/88.2 and another for 48/96/192. The crystal is the same and so I would assume that the filter is permanently set in the circuit prior to the crystals. Honestly, I am speculating about all of this.

The only reason I think he provides the 60 kHz sampling rate is due to the analog low pass anti aliasing filters being used. Which when set at 20 kHz don't push ultrasonic frequencies below -100 dBFS until you get to about 50 kHz. But even then 0 dBFS signal can only produce an alias of -60 dBFS as low as 20 kHz and any aliases lower than 20 kHz go down to -100 dBFS by 15 kHz. So the audibility of the aliases affecting the human audio bandwidth is minuscule. And, that they only go up by 5000-10000 Hz above the Human upper limit. Hence a Nyquist Frequency set at 30 kHz (60 kHz sample rate) eliminates all aliases that extend back into the audible domain using the same filter. This assumes that Mr Lavry's graph on page 20 is accurate and that the filters being utilized are of similar construct/performance.
__________________
Everything you need to know about samplerates and oversampling... maybe!
My Essential FREE 64bit VST Effects, ReaEQ Presets for Instruments
Windows 10 64 bit; MOTU 828 MKII, Audio Express, & 8PRE; Behringer ADA8000
insub is offline   Reply With Quote
Old 01-21-2015, 08:49 AM   #9
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

Quote:
Doesn't it smooth out the "digital steps"?
There are no digital "steps", that is only a visual, on paper representation (and a bad one at that or better yet a very bad mistake due to the confusion it has caused) vs. what really occurs. The waveform gets recreated thus no stair steps exist.
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 01-21-2015, 09:08 AM   #10
Magicbuss
Human being with feelings
 
Join Date: Jul 2007
Posts: 1,957
Default

Look we dont have to get overly technical when it comes to EQ and the Nyquist.

The problem with some EQ's (including reaEQ) is that the curve cramps as it approaches the nyquist. You can actually see this with ReaEQ. Just insert a peak filter with a fairly wide Q and sweep it toward 20k.

Here's a good explanation as to why you should care by none other than Vlad G.
https://vladgsound.wordpress.com/tag/cramping/


Cramping changes the curve and what started as a wide natural sounding boost becomes a more narrow harsher sounding boost. Analog EQ's don't cramp. The curve remains symmetrical at all points.

A typical way to remove cramping is to oversample. Decramped filters are sometimes referred to as analog mode on some EQ's. There's all kinds of marketing terms for it but the result is the same: symmetrical, unaltered curves as you approach the nyquist.

The only thing I don't know is whether cramping affects Shelving curves as well. lets face it most of us probably dont do alot of large, wide peak boosts above 10-12k. I'm usually much more inclined to use a shelf boost on OH's or vocals to provide air. Shelves sound more natural.

Last edited by Magicbuss; 01-21-2015 at 09:17 AM.
Magicbuss is offline   Reply With Quote
Old 01-21-2015, 09:23 AM   #11
brainwreck
Human being with feelings
 
Join Date: Jul 2006
Posts: 20,859
Default

Quote:
Originally Posted by Serenitynow View Post
So, isn't it more than just what frequencies we can here? Meaning the hz/khz can sound completely different if a piano and a sax play the same note/frequency. Isn't the smoothness and quality of reproduced tone of the sound enhanced by a higher freq. rate? Doesn't it smooth out the "digital steps"?

Rip me a new one if I have it all wrong!
You're talking about timbre. You might look at some wave shapes of sampled instruments to get an idea of what the timbre for various instruments look like. Theoretically, any sound can be recreated from sine waves, within the audible band (20 hz - 20k hz). It sounds crazy, I know, but we hear it every time we listen to a digital recording.

Low pass filters smooth the steps.
__________________
It's time to take a stand against the synthesizer.
brainwreck is offline   Reply With Quote
Old 01-21-2015, 09:28 AM   #12
insub
Human being with feelings
 
insub's Avatar
 
Join Date: Mar 2014
Location: Louisville, KY, USA
Posts: 1,075
Default

Awesome! Thanks for this Magic!!!

But a new question arises. What if your project sample rate is 88.2 or higher? Do your plugins such as ReaEQ also run at 88.2 which changes your Nyquist Frequency to 44.1 kHz and so cramping should not occur anywhere in the audible range?

Basically this could be the same as 2x oversampling in the DAW regardless what sample rate you recorded your audio at? i.e. all renders would be at the higher sample rate. Or doing so would make your interface crap out if not capable of higher sample rates?
__________________
Everything you need to know about samplerates and oversampling... maybe!
My Essential FREE 64bit VST Effects, ReaEQ Presets for Instruments
Windows 10 64 bit; MOTU 828 MKII, Audio Express, & 8PRE; Behringer ADA8000
insub is offline   Reply With Quote
Old 01-21-2015, 10:14 AM   #13
beginwhereur
Human being with feelings
 
Join Date: Jan 2013
Posts: 1,586
Default

Quote:
Originally Posted by insub View Post
My question regarding frequency and phase distortion around the Nyquist frequency is: How close to the Nyquist? I mean @44.1 kHz the Nyquist frequency is 2100 Hz above what is considered the upper limit of human hearing. Of any audio file that I've seen, very little information is recorded near the Nyquist. In any case, if these distortions are occurring in the top most 2000 Hz then they would most likely be beyond the capability of most playback systems, and outside the boundaries of most human perception even if they are of sufficient amplitude. Perhaps some EQs are deteriorating much lower than 2000 Hz below the Nyquist? I don't know, but I don't see why they would.
Not sure if this question has been answered for you. But the reason the sampling rate is set above the Nyquist region for a 20K signal has to do with low-pass filtering.

Everything above the given highest audio frequency (20K or so) must be filtered out, otherwise old Nyquist will be disturbed from his nap and become very grumpy. The problem is, it's difficult to implement a pleasant-sounding low-pass filter with an abrupt cut-off: you can't (and shouldn't) go from 20K down to zero without some area of transition. The extra room in the sampling rate that appears to allow for frequencies higher than 20K corresponds exactly to that margin of transition the low-pass filter needs. And so Nyquist snoozes none the wiser.

BTW, regardless of this transition area, these types of filters are still considered very steep by everyday audio standards, and so they're commonly called "brick-wall" filters.
beginwhereur is offline   Reply With Quote
Old 01-21-2015, 11:56 AM   #14
djjedidiah
Human being with feelings
 
Join Date: Nov 2011
Location: Denver, CO, USA
Posts: 447
Default

This explains why the stair steps don't exist


and this explains aliasing

djjedidiah is offline   Reply With Quote
Old 01-21-2015, 12:19 PM   #15
Refillable
Human being with feelings
 
Join Date: Sep 2012
Posts: 212
Default

Quote:
Originally Posted by beginwhereur View Post
Not sure if this question has been answered for you. But the reason the sampling rate is set above the Nyquist region for a 20K signal has to do with low-pass filtering.

Everything above the given highest audio frequency (20K or so) must be filtered out, otherwise old Nyquist will be disturbed from his nap and become very grumpy. The problem is, it's difficult to implement a pleasant-sounding low-pass filter with an abrupt cut-off: you can't (and shouldn't) go from 20K down to zero without some area of transition. The extra room in the sampling rate that appears to allow for frequencies higher than 20K corresponds exactly to that margin of transition the low-pass filter needs. And so Nyquist snoozes none the wiser.

BTW, regardless of this transition area, these types of filters are still considered very steep by everyday audio standards, and so they're commonly called "brick-wall" filters.
Yeah. And that's why they (whoever they are) claim that higher sampling rates are good for you, because then the AD anti-alias filters don't need to be as steep and will give less artifacts (it's called Gibbs phenomenon/Ringing if I remember correctly). But with a less steep anti-alias filter, you also get less filtering, and then oversampling comes into the picture. But it's been a while since I went to the university, so someone else need to explain oversampling in detail.
Refillable is offline   Reply With Quote
Old 01-21-2015, 12:36 PM   #16
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

Quote:
Originally Posted by djjedidiah View Post
This explains why the stair steps don't exist
Yea, I'm making it part my sig in about two minutes to save me time from posting the link to it so often.
__________________
Music is what feelings sound like.

Last edited by karbomusic; 01-21-2015 at 12:50 PM.
karbomusic is offline   Reply With Quote
Old 01-21-2015, 12:47 PM   #17
insub
Human being with feelings
 
insub's Avatar
 
Join Date: Mar 2014
Location: Louisville, KY, USA
Posts: 1,075
Default

Awesome videos Dj!

Although, that Melda video alarms me a bit. While I'm very happy that they are transparent enough to demonstrate aliasing occurring in their own product, shouldn't the aliasing problem be taken care of automatically?

In their example it is so easy to hear and see because they are using a single sine wave. But, with regular recorded audio signals I would speculate that measuring aliases won't be so easily recognizable. Shouldn't plugins be natively filtering out frequencies above the Nyquist/20kHz, or at the least automatically/permanently selecting oversampling?

If average upper frequency hearing degradation begins at age 8 then by age 33 I'm guessing I'm unable to notice most aliasing even if my monitoring system can reproduce those frequencies. Although, in that video the aliases most definitely went far enough down into the audible spectrum that I could hear the effect even coming from my iPhone speakers!
__________________
Everything you need to know about samplerates and oversampling... maybe!
My Essential FREE 64bit VST Effects, ReaEQ Presets for Instruments
Windows 10 64 bit; MOTU 828 MKII, Audio Express, & 8PRE; Behringer ADA8000
insub is offline   Reply With Quote
Old 01-21-2015, 01:44 PM   #18
brainwreck
Human being with feelings
 
Join Date: Jul 2006
Posts: 20,859
Default

Quote:
Originally Posted by djjedidiah View Post
This explains why the stair steps don't exist

Quote:
Originally Posted by karbomusic View Post
Yea, I'm making it part my sig in about two minutes to save me time from posting the link to it so often.
I know that is stated in the xiph video, but what I have read about conversion says that there is a sample and hold circuit involved in conversion before quantization and sometimes in reconstruction. The latest and greatest converters may differ. I don't know.
__________________
It's time to take a stand against the synthesizer.
brainwreck is offline   Reply With Quote
Old 01-21-2015, 01:45 PM   #19
whiteaxxxe
Banned
 
Join Date: Jul 2014
Location: United States of Europe, Germany, Mönchengladbach
Posts: 2,047
Default

Quote:
Originally Posted by Fergler View Post
Interested too, for example the big deal made over how an EQ curve shape is altered as it approaches the nyquist frequency - couldn't care less, but supposedly it's important. I would love to be swayed.
yep, I dont care too. but - like ReaDave showed some time ago - the curve, the Q, of an EQ doesnt sound the same, really hearable not the same, when oversampled, means Nyquist at 44.1 when 2times obersampled, as compared to not oversampled. the curve is different, and most eqs that dont oversample dont make that clear and show in a graph a frequency response that suggests that the curve is going up straight to Nyquist while in real there is a realtive steep curve going down and filter everything before Nyquist.

so in that range right before N that is not that really exciting stuff going on, mostly only HF-garbage, that noone wants ... but still. a not oversampled eq isnt able to have a HF-filter going straight up over 22.05.

not very spectatcular, but for the record.
whiteaxxxe is offline   Reply With Quote
Old 01-21-2015, 02:30 PM   #20
djjedidiah
Human being with feelings
 
Join Date: Nov 2011
Location: Denver, CO, USA
Posts: 447
Default

Quote:
Originally Posted by brainwreck View Post
I know that is stated in the xiph video, but what I have read about conversion says that there is a sample and hold circuit involved in conversion before quantization and sometimes in reconstruction. The latest and greatest converters may differ. I don't know.
http://en.wikipedia.org/wiki/Zero-order_hold

Look at this page and you'll see statements like:
Even though this is not what a DAC does in reality

Apart from that Monty mentions in the video that "some" converters "especially the simplest ones" use zero order holds, and even then, that is not a finished conversion, and it's not the signal that comes out.
djjedidiah is offline   Reply With Quote
Old 01-21-2015, 02:42 PM   #21
brainwreck
Human being with feelings
 
Join Date: Jul 2006
Posts: 20,859
Default

Quote:
Originally Posted by djjedidiah View Post
http://en.wikipedia.org/wiki/Zero-order_hold

Look at this page and you'll see statements like:
Even though this is not what a DAC does in reality

Apart from that Monty mentions in the video that "some" converters "especially the simplest ones" use zero order holds, and even then, that is not a finished conversion, and it's not the signal that comes out.
I realize that a stairstep is not what reaches the speakers. But there does seem to actually be a stairstep (or two) involved in the process of adc (sample and hold) and sometimes dac (sample and hold or zero order hold), at least for some converters.
__________________
It's time to take a stand against the synthesizer.
brainwreck is offline   Reply With Quote
Old 01-21-2015, 02:46 PM   #22
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

Quote:
Originally Posted by brainwreck View Post
I realize that a stairstep is not what reaches the speakers. But there does seem to actually be a stairstep (or two) involved in the process of adc (sample and hold) and sometimes dac (sample and hold or zero order hold), at least for some converters.
It does but IIRC and for lack of a better term, connecting the dots from that process results in an exact copy of the waveform. There is nothing else that makes the sound or any of its special qualities other than that final waveform. Getting out of my area but nyquist is basically answering the question "how tight does the resolution need to be in order to do that with those sampling steps". AKA, there is no series of gaps in the final waveform but how tight does it need to be in order to recreate an exact replica from that information. I know it's mind bending but that is exactly what it addresses.

That should be answered in the video though.
__________________
Music is what feelings sound like.

Last edited by karbomusic; 01-21-2015 at 02:51 PM.
karbomusic is offline   Reply With Quote
Old 01-21-2015, 02:49 PM   #23
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

The stair-step is just a representation, a visual. The full waveform can be recreated as it was so the visual of the sample steps is irrelevant to that.

Somebody, I forget who, did a test with live singers behind a curtain where they played the live signal from the singer and the recorded signal and, IIRC, nobody could reliably pick which one was real and which was the recording.
Lawrence is offline   Reply With Quote
Old 01-21-2015, 02:53 PM   #24
brainwreck
Human being with feelings
 
Join Date: Jul 2006
Posts: 20,859
Default

Quote:
Originally Posted by karbomusic View Post
It does but IIRC and for lack of a better term, connecting the dots from that process results in an exact copy of the waveform. There is nothing else that makes the sound or any of its special qualities other than that final waveform. Getting out of my area but nyquist is basically answering the question "how tight does the resolution need to be in order to do that with those sampling steps".
Actually, there are no dots to connect, other than in a visual graph. And considering quantization alone, the copy is a close approximation, but not exact.
__________________
It's time to take a stand against the synthesizer.
brainwreck is offline   Reply With Quote
Old 01-21-2015, 02:53 PM   #25
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

Quote:
Originally Posted by Lawrence View Post
The stair-step is just a representation, a visual. The full waveform can be recreated as it was so the visual of the sample steps is irrelevant to that.
Right but BW is speaking of the sampling process which is in increments/rate. However, just like you are saying, that is not what gets played back, it is then calculated back into a complete and full waveform just like the original waveform. What confuses people is the sampling "steps" being the actual audio instead of something used to reconstruct the original audio. There are no steps in the result.
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 01-21-2015, 03:04 PM   #26
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

Oh, for sure. I wasn't disagreeing with BW there. More just chiming in on the general subject matter.

The stair steps are always interesting because, as you suggest, it kinda depends on how you draw the connecting lines if they actually look like stair steps or not.

Good discussion.
Lawrence is offline   Reply With Quote
Old 01-22-2015, 03:05 PM   #27
The Telenator
Banned
 
Join Date: Dec 2011
Location: Oud West, NL
Posts: 2,335
Default

Quote:
Originally Posted by Lawrence View Post
The stair-step is just a representation, a visual. The full waveform can be recreated as it was so the visual of the sample steps is irrelevant to that.

Somebody, I forget who, did a test with live singers behind a curtain where they played the live signal from the singer and the recorded signal and, IIRC, nobody could reliably pick which one was real and which was the recording.
I was wondering when this thread would enter into the realm of Quantum Physic. Yes, try to capture one of these samples and show it to us. Yeah, just show us any one you like.

So, I think insub, our OP, approached this topic really well and asked pretty much all the right questions.

What didn't get covered at all here is the important part about what the Nyquist Frequency actually IS (hint, it's not a 'region'). Best way to think about it is as if it were a mirror. And what didn't get covered yet is what can actually happen. Our OP was good to ask things like, 'Why does it matter? It's WAY above our hearing range!" True, but because the frequency acts like a mirror, we can get what is called FOLDBACK wherein the frequencies that 'hit' and attempt to go beyond the Nyquist Frequency will be folded back and that means downward into some very audible audio bands. Which is not a pleasant thing at all.

Along with Foldback being basically completely overlooked in this thread, the nasty creature called 'Aliasing' seems to have been ignored. And aliasing is the real devil in all this here. It's inharmonic, meaning it really doesn't go well with the good or great sounds you've created and laid down on that track. Doesn't play well at all.
The Telenator is offline   Reply With Quote
Old 01-22-2015, 03:36 PM   #28
The Telenator
Banned
 
Join Date: Dec 2011
Location: Oud West, NL
Posts: 2,335
Default

Thinking about this a few minutes after, I realise that this now links us into that horrid other thread about 44.1k vs. 48k.

The argument came up there about the virtues of doing our mixing at higher sample rates that many of us use, namely (sanely rational ones such as) 88k and 96k. No one (I think) went into why some of us mix and process sound 'up there', but the best reason is simple: at 88 or 96 the Foldback and aliasing that occurs is almost guaranteed to be well above our range of hearing.

It's sort of similar to what some of the finer dithering plugins do -- the existing truncation noises they deal with and much of the noise they add in is then shoved way up higher, beyond 22kHz, and so is not even heard (or heard as well at all) in the finished product.
The Telenator is offline   Reply With Quote
Old 01-22-2015, 03:41 PM   #29
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

Quote:
Originally Posted by The Telenator View Post
I was wondering when this thread would enter into the realm of Quantum Physic. Yes, try to capture one of these samples and show it to us. Yeah, just show us any one you like.
We see them every day on the daw screen, but yes, they don't mean anything without each other. It's just a snapshot of waveform amplitude at a moment in time. Not exactly quantum physics.

But I do get your point. Thanks T.
Lawrence is offline   Reply With Quote
Old 01-22-2015, 03:49 PM   #30
insub
Human being with feelings
 
insub's Avatar
 
Join Date: Mar 2014
Location: Louisville, KY, USA
Posts: 1,075
Default

Quote:
Originally Posted by insub View Post
What if your project sample rate is 88.2 or higher? Do your plugins such as ReaEQ also run at 88.2 which changes your Nyquist Frequency to 44.1 kHz and so cramping should not occur anywhere in the audible range?

Basically this could be the same as 2x oversampling in the DAW regardless what sample rate you recorded your audio at? i.e. all renders would be at the higher sample rate. Or doing so would make your interface crap out if not capable of higher sample rates?
Quote:
Originally Posted by insub View Post
Shouldn't plugins be natively filtering out frequencies above the Nyquist/20kHz, or at the least automatically/permanently selecting oversampling?

If average upper frequency hearing degradation begins at age 8 then by age 33 I'm guessing I'm unable to notice most aliasing even if my monitoring system can reproduce those frequencies. Although, in that video the aliases most definitely went far enough down into the audible spectrum that I could hear the effect even coming from my iPhone speakers!
Still unanswered.
__________________
Everything you need to know about samplerates and oversampling... maybe!
My Essential FREE 64bit VST Effects, ReaEQ Presets for Instruments
Windows 10 64 bit; MOTU 828 MKII, Audio Express, & 8PRE; Behringer ADA8000
insub is offline   Reply With Quote
Old 01-22-2015, 03:57 PM   #31
The Telenator
Banned
 
Join Date: Dec 2011
Location: Oud West, NL
Posts: 2,335
Default

Quote:
Originally Posted by Lawrence View Post
We see them every day on the daw screen, but yes, they don't mean anything without each other. It's just a snapshot of waveform amplitude at a moment in time. Not exactly quantum physics.

But I do get your point. Thanks T.

Quantum Physics insists that as soon as you try to grab hold of anything that tiny, that it is actually in another position than where it was observed. A sample, being stored in a fixed location on a PC would not really qualify, but its billions of electrons I suppose would. Back to sample-size thinking and working with them on a DAW, I think the parallels in behavior are interesting.
The Telenator is offline   Reply With Quote
Old 01-22-2015, 04:05 PM   #32
The Telenator
Banned
 
Join Date: Dec 2011
Location: Oud West, NL
Posts: 2,335
Default

What about plugins that oversample (process at 88, 96, etc.)? That's one of the biggest reasons they DO oversample -- to avoid that Nyquist issue and aliasing.

Most plugins have a limit to their oversampling -- i.e., if track already at 96k, they won't double or triple that but use the existing rate.

You might be surprised how easy it is to hear 'bad stuff' no matter how much our hearing is degraded. I surprise myself almost every day!
The Telenator is offline   Reply With Quote
Old 01-22-2015, 04:19 PM   #33
timlloyd
Human being with feelings
 
Join Date: Mar 2010
Posts: 4,713
Default

Quote:
Originally Posted by insub View Post
What if your project sample rate is 88.2 or higher? Do your plugins such as ReaEQ also run at 88.2 which changes your Nyquist Frequency to 44.1 kHz and so cramping should not occur anywhere in the audible range?
Yes, it does change the Nyquist frequency (since it's half the sample rate). 'Cramping' in those EQs that are affected by it will still occur, but will be less obvious further away from 0 Hz and the Nyquist frequency. So, upsampling will reduce its effect in the audible range, though cannot remove or prevent it entirely.

Quote:
Shouldn't plugins be natively filtering out frequencies above the Nyquist/20kHz, or at the least automatically/permanently selecting oversampling?
That's a somewhat complex topic, and really depends on what the plug-in is attempting to achieve and how; though yes -- plug-ins should be preventing their own mess. There are too many pitfalls to expect users to deal with it all themselves.

Simply upsampling before non-linear processing (or always running projects at a very high sample rate) will actually result in *more* intermodulation distortion than otherwise (similar to aliasing, more info about that here), if the input signal isn't appropriately bandlimited.

Upsampling implies downsampling, which requires filtering. Filtering changes peak level, which can alter the processed signal such that what was possible before is no longer quite possible, or is possible but with further side-effects ... this means that the processing must be designed with this filtering taken into account from the beginning for best results. Not always possible unfortunately.

But yes -- where possible, non-linear processing should be fed with the narrowest input bandwidth you can get away with (to prevent unwanted IMD), and then further efforts should be taken to prevent aliasing before it occurs, rather than just upsampling to move the aliasing further away from the audible range. That's not always possible, in which case, upsample. Very basically

Last edited by timlloyd; 01-22-2015 at 04:25 PM.
timlloyd is offline   Reply With Quote
Old 01-22-2015, 04:22 PM   #34
Lawrence
Human being with feelings
 
Join Date: Mar 2007
Posts: 21,551
Default

Quote:
Originally Posted by The Telenator View Post
A sample, being stored in a fixed location on a PC would not really qualify, but its billions of electrons I suppose would.
I think we're maybe discussing at cross purposes here.

To me an individual sample point is nothing but a single mathematical amplitude value, there's really nothing "in it". It's just a measurement. There is no audio data in a sample point. It's just X amplitude at Y time. It's when you put all of the sample points back together to reconstruct a waveform that you get something audible.

I suppose if you knew how you could literally just draw a sax sound with sample points without ever playing a real sax, but yeah, that would be some feat for the human hand, drawing out such a complex wave shape dot by dot.
Lawrence is offline   Reply With Quote
Old 01-22-2015, 04:23 PM   #35
timlloyd
Human being with feelings
 
Join Date: Mar 2010
Posts: 4,713
Default

Quote:
Originally Posted by The Telenator View Post
You might be surprised how easy it is to hear 'bad stuff' no matter how much our hearing is degraded. I surprise myself almost every day!
Due to masking, people with certain kinds of hearing damage actually might more easily hear certain kinds of artefacts/distortions than people with 'normal' hearing. Lossy audio compression for example, is based on perceptual models of human hearing. For someone whose hearing deviates enough from those models, the artefacts that are designed to be inaudible may be audible at higher bit rates than for the average person. Probably only in fairly extreme cases, but still interesting.

Last edited by timlloyd; 01-22-2015 at 04:48 PM. Reason: That's why we're all destined to turn into Neil Young one day :p
timlloyd is offline   Reply With Quote
Old 01-22-2015, 04:33 PM   #36
The Telenator
Banned
 
Join Date: Dec 2011
Location: Oud West, NL
Posts: 2,335
Default

Quote:
Originally Posted by timlloyd View Post
Due to masking, people with certain kinds of hearing damage actually might more easily hear certain kinds of artefacts/distortions than people with 'normal' hearing. Lossy audio compression for example, is based on perceptual models of human hearing. For someone whose hearing deviates enough from those models, the artefacts that are designed to be inaudible may be audible at higher bit rates than for the average person. Probably only in fairly extreme cases, but still interesting.
Ha! Too True!

(And thanks for filling in some details above -- it must be a bit earlier in your day than where I am! Would need a fresh pot of coffee to go into all that now!)
The Telenator is offline   Reply With Quote
Old 01-22-2015, 04:36 PM   #37
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

Quote:
Shouldn't plugins be natively filtering out frequencies above the Nyquist/20kHz, or at the least automatically/permanently selecting oversampling?

If average upper frequency hearing degradation begins at age 8 then by age 33 I'm guessing I'm unable to notice most aliasing even if my monitoring system can reproduce those frequencies. Although, in that video the aliases most definitely went far enough down into the audible spectrum that I could hear the effect even coming from my iPhone speakers!
Irregularities introduced into the waveform (e.g. clipping, limiting, any type of assymetry, etc) create harmonics. These harmonics are multiples of that frequency. Let us imagine a sine wave of 1 kHz. Let us imagine that it is clipped and a series of harmonics are generated. Let us imagine that each harmonic goes down in amplitude by 6 dB. Let us take a samplerate of 44.1 kHz.

1st harmonic = 2 kHz -6 dB
2nd harmonic = 3 kHz -9 dB
3rd harmonic = 4 kHz -12 dB
etc

At this rate we are in no danger of hitting Nyquist, we don't even make it out of audible range before the harmonics drop below -60 dB. This is great, but this is at low frequencies - the situation changes if we consider higher frequencies! Okay, let us imagine that same waveshaping happening on a 5 kHz sine wave...

1st harmonic = 10 kHz -6 dB
2nd harmonic = 15 kHz -12 dB
3rd harmonic = 20 kHz -15 dB
4th harmonic = 25 kHz -18 dB -> reflected back to 19.1 kHz
5th harmonic = 30 kHz -21 dB -> reflected back to 14.1 kHz
6th harmonic = 35 kHz -24 dB -> reflected back to 9.1 kHz
7th harmonic = 40 kHz -27 dB -> reflected back to 4.1 kHz
etc

Do you see what I mean? We now have what may very well be audible and inharmonic signals scattered amongst the spectrum. This is, needless to say, bad.

Now let us imagine those same numbers, but with a samplerate of 88.2 kHz. We don't start folding back until -30 dB, and it doesn't come back into audible territory until the 15th harmonic, which in our example is around -84 dB. All it took is 2x oversampling and we've cleaned up our signal dramatically.

I'm presenting a pretty substantial clipping as an example, but that is the benefit of a higher sampling rate - if discontinuities and distortions happen in the digital realm, higher samplerates (or oversampling) help keep the harmonics generated from polluting our audible frequencies.

This was just an example, different forms of waveshaping introduce different harmonics at different amplitudes. I'm giving a somewhat theoretical example, the real world can be more forgiving... or less.
SaulT is offline   Reply With Quote
Old 01-22-2015, 04:39 PM   #38
timlloyd
Human being with feelings
 
Join Date: Mar 2010
Posts: 4,713
Default

Quote:
Originally Posted by Lawrence View Post
To me an individual sample point is nothing but a single mathematical amplitude value, there's really nothing "in it".
Yep. A LPCM encoded digital audio stream can be just a big list of amplitude values. That's why container formats like WAVE/AIFF need headers to hold metadata such as sample rate so that those values can be fired off at the correct rate to reproduce the encoded audio signal. The encoded signal itself does not include that information.

@T, it's near midnight here, but Question Time is boring!

Last edited by timlloyd; 01-22-2015 at 04:52 PM.
timlloyd is offline   Reply With Quote
Old 01-22-2015, 05:31 PM   #39
squidward
Banned
 
Join Date: Dec 2014
Posts: 62
Default

Quote:
Originally Posted by SaulT View Post
1st harmonic = 10 kHz -6 dB
2nd harmonic = 15 kHz -12 dB
3rd harmonic = 20 kHz -15 dB
4th harmonic = 25 kHz -18 dB -> reflected back to 19.1 kHz
5th harmonic = 30 kHz -21 dB -> reflected back to 14.1 kHz
6th harmonic = 35 kHz -24 dB -> reflected back to 9.1 kHz
7th harmonic = 40 kHz -27 dB -> reflected back to 4.1 kHz
etc
isn't the root the first harmonic ?
here you have your odds as evens and evens as odds...:P
squidward is offline   Reply With Quote
Old 01-22-2015, 05:32 PM   #40
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

Quote:
If average upper frequency hearing degradation begins at age 8 then by age 33 I'm guessing I'm unable to notice most aliasing even if my monitoring system can reproduce those frequencies.
I'm 34 and can still hear up to 17 kHz. Protect your hearing to the best you can, wear ear protection to concerts, etc.
SaulT is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.