R/E/P Community

Please login or register.

Login with username, password and session length
Advanced search  

Pages: [1]   Go Down

Author Topic: Reconstruction filters in converters  (Read 5797 times)

PookyNMR

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1991
Reconstruction filters in converters
« on: October 13, 2004, 07:20:55 PM »

I'm just learning here so pardon my ignorance...  Smile

I read in one of Nika's papers that converters use 'reconstruction filters' to take the samples and reproduce a waveform.  How do these filters work?

Thanks.

Nathan
Logged
Nathan Rousu

Nika Aldrich

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 832
Re: Reconstruction filters in converters
« Reply #1 on: October 13, 2004, 07:41:57 PM »

Pooky,

Did you read my paper on digital filters?  If so, can you be more specific about your question?  If not, the link is:

www.cadenzarecording.com/papers

I think I may understand your question, but give me some more verbiage so I can make sure we're on the same page before I try to answer.

Nika.
Logged
"Digital Audio Explained" now available on sale.

Click above for sample chapter, table of contents, and more.

PookyNMR

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1991
Re: Reconstruction filters in converters
« Reply #2 on: October 13, 2004, 11:13:04 PM »

Thanks for the response.  

Yes, I have the 'digital filters' paper.  I have not finished it yet.  (Maybe I'm 'jumping the gun' with this question...)  

Your 'digital distorition' paper on the TL audio site is the paper that I was referring to.

On page 3 you said:

"The process of recreating the original waveform involves a filter called a reconstruction  filter.  This filter removes all content above the Nyquist frequency (half the sample rate).  The range below the Nyquist frequency defines the ?legal? range of allowed frequencies  as frequencies in this range can be accurately reproduced. All frequencies above the  Nyquist frequency do not adhere to Nyquist or Shannon?s theorems regarding allowable  frequencies, cannot be reproduced and are therefore considered illegal frequencies.  Because of mathematical realities observed by Fourier in the 1800?s, and subsequently by  Shannon in 1948, when a waveform has all frequencies removed above the Nyquist  frequency, the resulting waveform will be the original waveform that was sampled."

This part I can understand.

Immediately following that you say:

"This process is significantly more involved than simply ?connecting the dots? between  sample points. Today it involves extremely sophisticated means of reconstructing the  waveform, using filters that are highly complex mathematical systems utilizing  ?oversampling,? ?upsampling,? ?linear phase, equiripple FIR? designs and much more.

This is the part that I am curious about.  How is the waveform actually reconstructed from the sample data?  How are oversampling, up-sampling, FIR filter(s) used to do this reconstruction?

Many thanks for your time!

Nathan
Logged
Nathan Rousu

PookyNMR

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1991
Re: Reconstruction filters in converters
« Reply #3 on: October 13, 2004, 11:24:05 PM »

sorry.  multiple post
Logged
Nathan Rousu

Nika Aldrich

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 832
Re: Reconstruction filters in converters
« Reply #4 on: October 13, 2004, 11:35:08 PM »

Nathan,

Thanks for your comments.  I need to go to bed and can answer your question in the morning.  Your quotes look like they are from a different paper, however.  Are you sure the paper you are referring to is the one at this link:

http://www.users.qwest.net/~volt42/cadenzarecording/Filters. pdf

The paper is about 45 pages and discusses these issues at length.  Agreed, my writing style is not always the easiest to follow and it is very likely that you'll have questions after reading this and I'm happy to answer them, but I just want to ensure that we are sharing the same information.

The process of oversampling is covered in section VI, starting on page 35  - at least in the PDF I have saved on my desktop.  The term "equiripple FIR" is not covered directly, but we can get into that if needed.  Upsampling is essentially the same as oversampling - one primarily used to discuss the D/A and the other to discuss the A/D.  We can go into that as well.

Let me know that we're on the same page and I'll be happy to continue and hopefully be more clear.

Nika.
Logged
"Digital Audio Explained" now available on sale.

Click above for sample chapter, table of contents, and more.

PookyNMR

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1991
Re: Reconstruction filters in converters
« Reply #5 on: October 13, 2004, 11:40:08 PM »

You replied before I could finish editing my post!  Smile  Yes, it was the 'digital distortion' paper from the TL audio site that I read.

I have the digital filters paper now and will finish reading that one tonight.

Thanks,

Nathan
Logged
Nathan Rousu

danlavry

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 997
Re: Reconstruction filters in converters
« Reply #6 on: October 14, 2004, 03:04:34 AM »

“Immediately following that you say:

"This process is significantly more involved than simply ?connecting the dots? between sample points. Today it involves extremely sophisticated means of reconstructing the waveform, using filters that are highly complex mathematical systems utilizing ?oversampling,? ?upsampling,? ?linear phase, equiripple FIR? designs and much more.

This is the part that I am curious about. How is the waveform actually reconstructed from the sample data? How are over sampling, up-sampling, FIR filter(s) used to do this reconstruction?

Many thanks for your time!

Nathan”


Well Nathan, the wording “highly complex mathematical systems”  is just a different way of saying “beyond the scope of this thread”.  A lot of what we are talking about can fall into that category. But given that we are here, trying to communicate the best we can, I’ll take a stub at it.

Let’s think of a sloping straight line. You could take a pen and draw it on a paper. That is an “analog line”. After the AD conversion, you do not have an analog line. You have equally spaced dots. That is the “digital data”. How do you make it back into an analog line? You plot the dots on a different page, and you connect them.

Of course, life would be simple if we could connect the dots with straight lines for all shapes. But try it with a circle; say with only four equally spaced dots (90 degrees apart) the outcome is a square! With 8 dots (45 degrees apart)the shape (an octagon - eight sided daimond like) gets rounder looking but it is not a circle. But either way, with straight lines you end up with sudden change in direction (corners).

Suppose I tell you that you are not allowed to perform an immediate change in direction. No corners. You can not go for a sudden or sharp bend in the line. In a sense I am telling you to “round the corners”. Everything that moves slow is “left intact’ but any attempt to make a fast change is encountered with a lot of “rounding and smoothing”. With these “rules”, the square (or octagon) curve will be smoother, more circle like…

Rounding and smoothing is what a low pass filter does. “Low pass” means to allow slow changes to pass through intact. But low pass (passing low frequencies) is a “high reject”, thus not allowing for fast changes - sharp corners - quick changes, thus rejecting the high frequency content.

There are many mechanisms and forms for such filtering (smoothing) action. For analog low pass, think again of that big swimming pool – you can fill it and empty it given some time, but with some limited size pipe, it takes time. It can not happen at very high speed. The same is true for charging and discharging a capacitor with limited current. That description is good one for a very elemetry filter. A more complex network of capacitors and resistors and other parts makes a much better smoothing machine and a better filter.

Here is the amazing part: When you build a filter that is good enough to pass all the slow motion (low frequencies, everything below Nyquist) but reject all the fast motion (high frequencies above Nyquist), you end up with the perfect smoothing machine that will give you back the precise curve. It will connect the 4 dots of the circle with a perfect circle!!!
The closer you get to passing the energy below Nyquist and rejecting the energy above Nyquist, the closer the curve will be to the original circle “or audio waveform”. A perfect filter yields the perfect curve fitting. In fact, the perfect filter is the perfect curve fitter; they are one in the same!

Does it always work? Well, it does work if some takes care of some relationship in the conversion - The relationship between how fast the signal can change and how tightly spaced the samples are.  
How fast the signal can change is set by the audio bandwidth. “40KHz audio” changes faster than "20KHz audio", so it needs twice as many samples… Once your audio bandwidth is less then 1/2 the sample rate, your filter is a perfect curve fitter. If the audio bandwidth is more than 1/2 the sample rate, the filter is not a perfect smoother and the reconstructed wave is not a perfect match to the original wave. That is Nyquist theorem on a gut level.

BR
Dan Lavry
Logged

PookyNMR

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1991
Re: Reconstruction filters in converters
« Reply #7 on: October 14, 2004, 11:07:33 AM »

Thanks guys, this is an incredible learning opportunity.

I did finish Nika's 'digital filters' paper last night.

I now have (or think I have) a basic understanding of IIR and FIR filters.  I do have some first year University calculus and linear algebra classes under my belt so the math did not scare me too much.  Smile

If I understand correctly, the waveform (voltage) is reconstructed from the sample data by upsampling the original sample ("smoothing the circle" to borrow Dan's analogy).  These new samples from the upsampling are they created by runing the original samples value through a 'windowed' FIR filter.  Correct?

Thanks.

Nathan
Logged
Nathan Rousu

danlavry

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 997
Re: Reconstruction filters in converters
« Reply #8 on: October 14, 2004, 01:57:24 PM »

PookyNMR wrote on Thu, 14 October 2004 16:07

Thanks guys, this is an incredible learning opportunity.

I did finish Nika's 'digital filters' paper last night.

I now have (or think I have) a basic understanding of IIR and FIR filters.  I do have some first year University calculus and linear algebra classes under my belt so the math did not scare me too much.  Smile

If I understand correctly, the waveform (voltage) is reconstructed from the sample data by upsampling the original sample ("smoothing the circle" to borrow Dan's analogy).  These new samples from the upsampling are they created by runing the original samples value through a 'windowed' FIR filter.  Correct?

Thanks.

Nathan


I have 2 basic paper on FIR's and IIR's at www.lavryengineering.com under the support section.

BR
Dan Lavry
Logged

PookyNMR

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1991
Re: Reconstruction filters in converters
« Reply #9 on: October 14, 2004, 03:46:21 PM »

Got all your papers now.  Thanks!

Nathan
Logged
Nathan Rousu

Nika Aldrich

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 832
Re: Reconstruction filters in converters
« Reply #10 on: October 14, 2004, 04:16:30 PM »

PookyNMR wrote on Thu, 14 October 2004 16:07

I did finish Nika's 'digital filters' paper last night.


Nathan,

First, definitely read Dan's papers that you downloaded.  They are very good and were a huge part of my own foundation of understanding.  I think they get a little thick at times - Dan, as the mathematician, approaches the issues from a different angle than resonated well in my head - especially on IIR filters.  But definitely parse through those.

Quote:

I now have (or think I have) a basic understanding of IIR and FIR filters.  I do have some first year University calculus and linear algebra classes under my belt so the math did not scare me too much.  Smile


Then you're way ahead of me on the math side of things!

Quote:

If I understand correctly, the waveform (voltage) is reconstructed from the sample data by upsampling the original sample ("smoothing the circle" to borrow Dan's analogy).  These new samples from the upsampling are they created by runing the original samples value through a 'windowed' FIR filter.  Correct?


Close.  First, there is only one "legal" way for a waveform that is band limited properly to run through those sample points.  Any other way of running through those points will inherently yield high frequency material above the Nyquist frequency.  So we filter the waveform so that nothing is in it above Nyquist and that ensures that the dot-to-dot connection happens in the only acceptable way - the original way.

So first we throw a bunch of samples between each sample point (oversampling or upsampling).  We throw those samples in at "0" because we really don't know where they are supposed to go, yet.  Let's say we put 15 "0" samples between each sample.  We just oversampled 16x.  But the waveform that this "appears" to produce is not the original waveform.  We have to "assign" all of those "0" values to where they are actually supposed to go.  We do this by running all of the samples (old and the 'tweener samples) through a windowed FIR filter.  This process removes all frequency content above Nyquist and we're left with a representation of the waveform that "looks" much more like the original waveform it is to represent.  

But this is still a discreet sampling system - in that it is still sampled.  We still have to turn this into analog.  So what we do is complete our D/A conversion and accept for a moment that the D/A converter is NOT going to accurately reconstruct the waveform between all of those little samples.  It is going to turn each sample point into the proper voltage, but the information between those 16x sample points is not going to be right.  So after the D/A conversion we again run the audio through a filter to remove info above the new Nyquist frequency (22.05KHz x 16).  Since this filter is going to have to be an analog filter it is inherent that it will be in IIR filter.

So the complete signal path is:

Digital audio in (1x, or 44.1KS/s) -> Add 15 extra samples for each sample in the system -> Run all of that through a windowed FIR linear phase filter to remove all content above 22.05KHz, essentially "assigning" the inbetween samples to "real" values -> D/A conversion -> IIR filter to remove rest of the HF material created through the D/A conversion process

What we end up with is the original signal.

Does that answer the question?  I know it will start a few more.  I'm ready.  Smile  Do you understand, for example, WHY we do the two-step on the filtering, filtering once before conversion and once after?

Nika.
Logged
"Digital Audio Explained" now available on sale.

Click above for sample chapter, table of contents, and more.

PookyNMR

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1991
Re: Reconstruction filters in converters
« Reply #11 on: October 15, 2004, 01:03:55 AM »

Nika Aldrich wrote on Thu, 14 October 2004 14:16


Does that answer the question?  I know it will start a few more.  I'm ready.  Smile  Do you understand, for example, WHY we do the two-step on the filtering, filtering once before conversion and once after?

Nika.


Yes.  Thank you.  I think I have it now.  The multiple filters make total sense.

After I go through all of Dan's papers I'm sure I'll have plenty more questions.  Hold on to your keyboard!

Thanks again.

Nathan
Logged
Nathan Rousu
Pages: [1]   Go Up
 

Site Hosted By Ashdown Technologies, Inc.

Page created in 0.039 seconds with 19 queries.