PCM encoding vs high frequency representation problem?
Nov 14, 2006 at 1:13 AM Post #16 of 24
Quote:

Originally Posted by Garbz
22.05kHz can not actually be displayed. Nyquests theorm requires the sampling rate to be significantly greater than frequency. Even 21kHz is pushing it with some modulation resulting.

Zenja yeah soundforge connects the dots, I think it's a setting somewhere to smoother over it or whatever. It makes it easier to see when aliasing filters are failing after resampling etc. My frame was of a pure 20kHz signal at -0dB not of music. The fact that there's a curvy line through it or not makes no difference, the location of the dots are the important thing
wink.gif
. The point was a sine function is hard to approximate without more than 2 dots.

As for the comparison:
attachment.php


The top one has a 16:1 zoom, the bottom a 1:1. You can clearly see (or rather can't because the dots are so close together) that a 60hz wave has many samples to approximate it.



Bah, I just noticed that the Nyquist frequency, as an upper bound, is not included (Doh).

The Nyquist-Shannon theorem states that aliasing can be avoided if the Nyquist Frequency (Half the sampling rate) is greater than the bandwidth!! Clearer, I thought the Nyquist Frequency could also be represented, I wasn't paying enough attention, but this seems fishy still. What happens when you tend toward the Nyquist frequency without attaining it (Or does the theorem only apply to integer frequencies?)? Wouldn't you still get aliasing problems (Mostly getting only 2 points + an odd point every so often. Can the aliasing problem be resolved in such a case? Most probably not I would think)?. Indeed, 22.05 Khz can not be represented because then the bandwidth would be <= to the Nyquist frequency which means we would get EXACTLY a maximum of 2 points to represent the curve (Infinite aliasing at exactly the Nyquist Frequency).
 
Nov 14, 2006 at 4:53 AM Post #17 of 24
Quote:

Originally Posted by El Condor
Well, the theoritical limit for a perfect reconstruction of signal for a finite bandwidth is to sample at exactly twice the bandwidth. I'm not fluent in Nyquist so maybe I'm missing something (like a way to resolve aliases to perfectly reproduce the original waveform)
rs1smile.gif
.

What was your sampling rate? 44.1Khz?

EDIT: Hmmm, I just noticed that you used a sampling rate of 48Khz. I don't understand then because you should easily be able to represent 20Khz (more than only 2 points per Hz). The Nyquist Frequency for a sampling rate of 48Khz is 24Khz and the bandwidth is below 24Khz (only 20Khz).



If you look at the signal more than 2 points are represented. Otherwise the point would fall in exactly the same place every time. Which also brings rise to another problem in the Nyquest theorm. Suppose you have a 48kHz sampling rate and then a 24kHz sine wave. The output would in theoretical conditions be a triangle wave one point at each peak or dip, 2 points per period. Now given the same time base try it with a cosine wave. The pi/2 phase shift means that now every single sample is 0. The 2 points now represent the zero crossings, rather than the peaks and dips.

If you tend to the nyquest frequency without attaining it. Say 22khz for a 44.1khz wave you start to see 2 waves modulated on each other. The triangles then come appear to follow a sine wave. I have an exam in 2 hours so I don't have time to graph an example on matlab, but I'll show you what i mean later.

/EDIT: Actually I realised I can do this without matlab, here's a 23khz signal with a 48khz sampling rate. Note the similarities to the 20khz wave at 48khz fs I posted above. The samples above seem to have a very quick sine modulation. The samples following much slower modulating over more samples, the closer you approach the nyquest frequency the lower in frequency this modulation becomes:
attachment.php
 
Nov 14, 2006 at 2:35 PM Post #18 of 24
Quote:

Originally Posted by Garbz
If you look at the signal more than 2 points are represented. Otherwise the point would fall in exactly the same place every time.


Hmmm, true
rs1smile.gif
. So 2.4 points per cycle? To be able to reconstruct the wave more accurately, I'm guessing the reconstruction algorithm would have to look at the sample through time to be able to detect a trend?

Quote:

Originally Posted by Garbz
Which also brings rise to another problem in the Nyquest theorm. Suppose you have a 48kHz sampling rate and then a 24kHz sine wave. The output would in theoretical conditions be a triangle wave one point at each peak or dip, 2 points per period. Now given the same time base try it with a cosine wave. The pi/2 phase shift means that now every single sample is 0. The 2 points now represent the zero crossings, rather than the peaks and dips.


Yes, I had visualized this problem [Infinite aliasing at the Nyquist Frequency both in phase and amplitude]

Quote:

Originally Posted by Garbz
If you tend to the nyquest frequency without attaining it. Say 22khz for a 44.1khz wave you start to see 2 waves modulated on each other. The triangles then come appear to follow a sine wave. I have an exam in 2 hours so I don't have time to graph an example on matlab, but I'll show you what i mean later.


Hope everything went well on your exam
rs1smile.gif
. What was the exam about?

So, why would you see 2 waves modulations? I thought you were using pure sine waves?

Quote:

Originally Posted by Garbz
/EDIT: Actually I realised I can do this without matlab, here's a 23khz signal with a 48khz sampling rate. Note the similarities to the 20khz wave at 48khz fs I posted above. The samples above seem to have a very quick sine modulation. The samples following much slower modulating over more samples, the closer you approach the nyquest frequency the lower in frequency this modulation becomes:
attachment.php



Where is this modulation coming from if we're dealing with pure sine waves in the original signal
blink.gif
?
 
Nov 15, 2006 at 1:24 AM Post #19 of 24
My exam was on filter design. They gave a design with an opamp integrator taking square wave inputs and said design a sinewave generator.
Pick values for R/C, express vfilt as a fourier series, design a transfer function that ensures all harmonics are 40dB lower than the fundemental, impliment said function. I'm surprised I did so well.

Those modulations are hard to explain so now i'm pulling out matlab and pen and paper
evil_smiley.gif


Below is an image in matlab graphing the function sin(2/1.9*pi/x). I have chosen the period as 2pi/1.9 because this meas the sine function will nearly fall perfectly on every major value of x. infact in this function sine is zero at 0, 0.95, 1.9, 2.85, 3.8 etc. Just like a sine wave that approaches but has not yet reached it's nyquest frequency.

The blue line represents the sine function, the black dots represent the point where this function crosses a major number, so point 1 is 0, point 2 is the sine function where x=1, point 3 x=2 etc etc. These are the actual sampling points of the sampling rate. The red line is then these points joined up to see the trend.

That is where the modulation comes from, however I am still not sure if that modulation can not be eliminated by some kind of digital filtering. (I'm pretty proud of that effort
smily_headphones1.gif
excuse the focus )

attachment.php
 
Nov 15, 2006 at 1:59 AM Post #20 of 24
Quote:

Originally Posted by Garbz
My exam was on filter design. They gave a design with an opamp integrator taking square wave inputs and said design a sinewave generator.
Pick values for R/C, express vfilt as a fourier series, design a transfer function that ensures all harmonics are 40dB lower than the fundemental, impliment said function. I'm surprised I did so well.



Great, glad it went well
rs1smile.gif
. What are you studying?

Quote:

Originally Posted by Garbz
Those modulations are hard to explain so now i'm pulling out matlab and pen and paper
evil_smiley.gif



Go Garbz, Go Garbz
tongue.gif
.

Quote:

Originally Posted by Garbz
Below is an image in matlab graphing the function sin(2/1.9*pi/x). I have chosen the period as 2pi/1.9 because this meas the sine function will nearly fall perfectly on every major value of x. infact in this function sine is zero at 0, 0.95, 1.9, 2.85, 3.8 etc. Just like a sine wave that approaches but has not yet reached it's nyquest frequency.

The blue line represents the sine function, the black dots represent the point where this function crosses a major number, so point 1 is 0, point 2 is the sine function where x=1, point 3 x=2 etc etc. These are the actual sampling points of the sampling rate. The red line is then these points joined up to see the trend.

That is where the modulation comes from, however I am still not sure if that modulation can not be eliminated by some kind of digital filtering. (I'm pretty proud of that effort
smily_headphones1.gif
excuse the focus )

attachment.php



Ahhhhhhhhhhh!!!! Limpid! I clearly understand now. This also means that it's probably possible to reconstruct nearly perfectly a sine wave less than the nyquist frequency by looking at the wave through time so that a filter is allowed to take into account the modulation. For sustained samples, it would most probably be possible to come closer to a perfect reproduction but for shorter samples, I still don't see how it would be possible to get a perfect result. It seem like an approximation would be the best bet in such a case.

Thanks very much for taking the time to explain me a few things. I have a clearer understanding of all this now
blink.gif
.
 
Nov 15, 2006 at 6:02 AM Post #21 of 24
No worries. No prizes for guessing that I study electrical engineering :p, we start getting into really heavy digital work next year where we may even learn how all this works in detail. As for now most of my work is still in the analog domain. And speaking of which I have a maths exam to get to. Yay for laplace transforms and convolution.
eek.gif
 
Nov 15, 2006 at 6:51 AM Post #22 of 24
Quote:

Originally Posted by Garbz
No worries. No prizes for guessing that I study electrical engineering :p, we start getting into really heavy digital work next year where we may even learn how all this works in detail. As for now most of my work is still in the analog domain. And speaking of which I have a maths exam to get to.


Electrical engineering sounds like much fun then if you ask me
tongue.gif
. I should have looked into that one a bit more
rs1smile.gif
. Hey, its never too lake, maybe I'll give it a shot instead of going for pure math.

Well have fun studying and thanks again for your help
rs1smile.gif
.

Quote:

Originally Posted by Garbz
Yay for laplace transforms and convolution.
eek.gif



Hahaha, I'm certain somebody's head exploded somewhere.
 
Nov 16, 2006 at 7:52 AM Post #23 of 24
Quote:

Originally Posted by El Condor
Hello,

I stayed up late last night trying to understand sampling vs bandwidth and I think I got it down. I understand why sampling needs to be double the bandwidth
blink.gif
(Nyquist-Shannon sampling theorem).

From what I understand, it would be very clear that lower frequencies are privileged as far as accuracy in representation goes. Going higher in the frequency spectrum, what I perceive is that the frequencies will be less accuratly portrayed using PCM encoding. Is this correct? If this is the case, then how do anti-aliasing algorithms cope with this problem? 1Hz being the most precisely represented frequency, I understand that there would be a loss in representation accuracy in the sampling dimension of 1/2 for every Hz in excess of 1. Maybe I misunderstand all this but what are the implications on anti-aliasing and accurate representation of the underlying music in the higher frequency?

I'm really curious and want to understand all this so I can have a thorough understanding of what the DAC does when it oversamples and anti-aliases the signal (I think I got the oversampling down also. It makes sense to me in a context of converting digital to analog).

Anyways, any thought on the subject would be appreciated.
rs1smile.gif
.

I have a computer science background and I'm not completely ignorant about electronic (mostly digital that is. I don't understand analog signal processing as well) so feel free to shoot at will. If there's enough information available, I should be able to figure things out
tongue.gif
.



There are many well intentioned but 'not quite' anwers to your question. Part of the problem is that your question is open-ended, as you don't seem sure of what you don't understand exactly, yet seek a concise answer to a very broad topic that can lead down many paths. Related material is typically covered over multiple upper undergrad / graduate level courses in EE ranging from mathematical theory to implementation details. A good reference for the mathematical side (which I presume you're really asking about) is a book like Oppenheim and Schafer.

Do not try to apply technical theory such as this and expect to make an informed purchasing decsion on the sonic characteristics of a DAC as a consequence. Trust your ears.

P.S. EE can be pure math depending on the path one takes within it.
 
Nov 16, 2006 at 2:53 PM Post #24 of 24
Quote:

Originally Posted by SnoopyRocks
There are many well intentioned but 'not quite' anwers to your question. Part of the problem is that your question is open-ended, as you don't seem sure of what you don't understand exactly, yet seek a concise answer to a very broad topic that can lead down many paths.


You framed the situation pretty well I would say. Open-ended questions are the best kind
rs1smile.gif
(As you mention, it's somewhat difficult to ask specific questions when you don't completely know what you're asking
blink.gif
). I didn't get a complete answer, but I did get a bunch of small bits which I'm knitting together into a better comprehension. Garbz, in particular, has been very patient and helpful. In any case, I'm somewhat inclined to think that most on this forum are not necessarilly interrested in understanding the inner workings in detail.

Quote:

Originally Posted by SnoopyRocks
Related material is typically covered over multiple upper undergrad / graduate level courses in EE ranging from mathematical theory to implementation details. A good reference for the mathematical side (which I presume you're really asking about) is a book like Oppenheim and Schafer.


Not really asking for any book in particular, but thanks for the reference, I'll take a look. I mostly like discussing about ideas
wink.gif
.

Quote:

Originally Posted by SnoopyRocks
Do not try to apply technical theory such as this and expect to make an informed purchasing decsion on the sonic characteristics of a DAC as a consequence. Trust your ears.


Never part of my plan. It will take awhile to acquire a very good understanding and I'm too impatient to wait that long to decide if a DAC is good or not (listening seems like a better approach
rs1smile.gif
). I have a Zhaolu D2.5C with discrete amp upgrade in the mail right now. It should get here tomorrow!!
tongue.gif


Quote:

Originally Posted by Snoopyrocks
P.S. EE can be pure math depending on the path one takes within it.


Understandably, but they are applied mathematics, I much prefer the "useless" kind
rs1smile.gif
(Pure math without applications...yet).
 

Users who are viewing this thread

Back
Top