16x Digital interpolation filter - drive PCM56, PCM58, AD1865 and so on up to 768 kHz

I cannot promise it will work though. It purely depends on the available clocks. However, as mentioned within first post following lower frequency clocks (usually BCLK which can be connected to MCLK input of my digital filter) can work as a master clock (MCLK) signal:

6.144 MHz
5.6448 MHz
4.608 MHz *
4.2336 MHz *
3.072 MHz
2.8224 MHz
1.536 MHz
1.4112 MHz
 
I cannot promise it will work though. It purely depends on the available clocks. However, as mentioned within first post following lower frequency clocks (usually BCLK which can be connected to MCLK input of my digital filter) can work as a master clock (MCLK) signal:

6.144 MHz
5.6448 MHz
4.608 MHz *
4.2336 MHz *
3.072 MHz
2.8224 MHz
1.536 MHz
1.4112 MHz
Extremely impressive what you have achieved.
What could possibly be the reason that a long FIR filter sounds better than a shorter version as usually found in Dac’s
Looking at spec’s from Dac’s, they all have very low pass band ripple, very high stop band suppression, linear phase and low THD.
But all (digital) filters suffer from time smearing, the sharper the transition from pass to stop, the more “smearing”. No filter can escape these physical laws.
So there must be something else why longer filters are sounding better, any idea why ?

Hans
 
Extremely impressive what you have achieved.
What could possibly be the reason that a long FIR filter sounds better than a shorter version as usually found in Dac’s
Looking at spec’s from Dac’s, they all have very low pass band ripple, very high stop band suppression, linear phase and low THD.
But all (digital) filters suffer from time smearing, the sharper the transition from pass to stop, the more “smearing”. No filter can escape these physical laws.
So there must be something else why longer filters are sounding better, any idea why ?

Hans

Psychology? ;)

A typical synchronous interpolation filter like this, being LTI, doesn't create harmonic distortion. You don't see that specified on filters like this.

This "time smearing" isn't an artifact, so I really dislike using that term for it. An ideal reconstruction filter will have this "time smearing", but it will reconstruct the original waveform perfectly. It's not actually time smearing, because we don't listen to impulses.

It's often possible to improve on the built-in filters because they typically allow for some aliasing in the transition band in order to meet the marketing requirement of a 20 kHz passband with the number of taps they are afforded.

This is a really nice effort. I'd definitely get one if I were using one of the DACs it's designed to interface with.
 
Last edited:
Psychology? ;)

A typical synchronous interpolation filter like this, being LTI, doesn't create harmonic distortion. You don't see that specified on filters like this.

This "time smearing" isn't an artifact, so I really dislike using that term for it. An ideal reconstruction filter will have this "time smearing", but it will reconstruct the original waveform perfectly. It's not actually time smearing, because we don't listen to impulses.

It's often possible to improve on the built-in filters because they typically allow for some aliasing in the transition band in order to meet the marketing requirement of a 20 kHz passband with the number of taps they are afforded.

This is a really nice effort. I'd definitely get one if I were using one of the DACs it's designed to interface with.
I don’t get this aliasing, I see no technical reason for that, but I agree that the signal might become corrupted by this filter process in some way and that longer filters may produce lesser corruption anomalies.

Hans
 
I don’t get this aliasing, I see no technical reason for that, but I agree that the signal might become corrupted by this filter process in some way and that longer filters may produce lesser corruption anomalies.

Hans

Uh... The filter must be in the stopband by the Nyquist frequency in order to avoid any aliasing.

Most DACs have built in filters which have specs like Passband: 0.454*Fs, Stopband: 0.546*Fs (taken from PCM1792A datasheet).

This means the filter is not fully into the stopband until 24.078 kHz when Fs = 44.1 kHz. This is > Fs/2. The passband is conveniently 20.02 kHz. This is chosen so the marketing department doesn't have to explain why their DAC isn't flat to 20 kHz. The filter would have to be longer in order to narrow the width of the transition band.


There's no need to talk about ambiguous corruption, because it's all quantifiable. Fortunately, 3lite has produced a nice set of filters here.
 
Last edited:
Uh... The filter must be in the stopband by the Nyquist frequency in order to avoid any aliasing.
Nyquist can stay at home, we are discussing filtering of an upsampled signal. No aliasing or backfolding takes place.
And in case the digital filter leaves some residue from 22kHz to 24kHz, this will simply appear in the analogue signal after d/a conversion still residing at 22kHz to 24kHz.
I don't think anyone will notice that.


Hans
 
Nyquist can stay at home, we are discussing filtering of an upsampled signal. No aliasing or backfolding takes place.
And in case the digital filter leaves some residue from 22kHz to 24kHz, this will simply appear in the analogue signal after d/a conversion still residing at 22kHz to 24kHz.
I don't think anyone will notice that.


Hans

Yes, you are discussing about an upsampled signal, but upsampling (without low pass filtering) means introducing (deliberately) images of the original signal to increase the sample rate by inserting zeros into the signal. That being the case you have plenty of images / back-folding taking place. In order to fix that you need to low pass the upsampled signal to get rid of it.

The following image should explain it pretty well:

H0G8muc.png


chris719 explained very well why normal digital filters aren't very good due to limited amount of resources (taps). They all pretty much allow for some back-folding due to not achieving full attenuation (stop band) by 0.5 fs.

Also, please have a look at this:

Audio DAC shapes

There is hardly any DAC / digital filter there capable of reconstructing 24 kHz sine wave due to the issue pointed out by chris719.

Hi 3Lite, my intention is to run Ian's I2S to PCM after this as I am building balanced dac. Do you foresee any issues with this configuration?

You do not need Ian's board for anything. It's doing the exact thing my digital filter does already which is splitting I2S into so called "PCM" with both inversed and non-inversed data signals ;)
 
Yes, you are discussing about an upsampled signal, but upsampling (without low pass filtering) means introducing (deliberately) images of the original signal to increase the sample rate by inserting zeros into the signal. That being the case you have plenty of images / back-folding taking place. In order to fix that you need to low pass the upsampled signal to get rid of it.

The following image should explain it pretty well:

H0G8muc.png


chris719 explained very well why normal digital filters aren't very good due to limited amount of resources (taps). They all pretty much allow for some back-folding due to not achieving full attenuation (stop band) by 0.5 fs.

Also, please have a look at this:

Audio DAC shapes

There is hardly any DAC / digital filter there capable of reconstructing 24 kHz sine wave due to the issue pointed out by chris719.



You do not need Ian's board for anything. It's doing the exact thing my digital filter does already which is splitting I2S into so called "PCM" with both inversed and non-inversed data signals ;)
I don't want to make some principal case of who's wrong or who is right, but I give it one more final attempt.

Could you explain how any frequency can fold back when the DAC is outputting the signal with the same frequency as the digital filter.
Downfolding or aliasing can only happen when you downsample after filtering like in a studio where Audio is recorded at 384kHz and after digital filtering is down sampled to 44.1Khz.
Or is that what also happens in your filter, in that case you are right.
But if not, if you apply a digital filter or not, as long as the DAC is operating at the same speed, the analoque signal will be exactly like the digital content, but with many mirrors around Fs and convoluted with a Sinc function.
With no digital filter you will have the same performance as a NOS Dac with many ultra sonic mirrors, and in case of a digital filter most primary mirrors will be removed, and a slow analogue filter will remove the mirrors around Fs resulting in a rather clean signal limited to ....kHz.


Hans


P.S. Thank you for the Audio DAC shapes link, a very interesting comparison.
And again, great respect for the filter you made, a colossal job well done.
 
Hans makes an interesting point: Foldback typically occurs during reproduction, not recording. Upsampling should cause HF images to be played back as HF music, not folded back (that is, so long as images do not exceed the upsampled Nyquist).
 
Last edited:
Or is that what also happens in your filter, in that case you are right.

Actually yes, that is how my filter works ;) It is basically a synchronous sample rate converter. Unlike normal digital filters which do have a staged architecture (e.g. one stage of interpolating from 1x -> 2x and the other from 2x -> 8x). Depending on the input stream those stages are omitted to result in selectable interpolation ratio of 2x, 4x or 8x, but they do always interpolate nonetheless (no decimation). In order to achieve similar behavior I have decided to interpolate and decimate at the same time depending on the input stream. I did mention it within the first post :)

Also, might be worth keeping in mind that you have analogue electronics after the DAC which can cause non-linear or intermodulation distortion and other issues if the input has mirrored images of higher frequency which can in fact cause issues in the audible band.

I have seen something like this already when I was testing filter coefficients with higher passband and the only difference were the coefficients and the allowed passband. Certain artifacts did appear within audible band. The funny fact is that throughout this project I have seen artifacts within audible band due to different things (dithering, clocking, allowed passband and so on) and I couldn't really explain them myself except for trying a different approach to fix them.
 
Last edited:
Account Closed
Joined 2010
You said about PCM1792 that is not quite right...
Well, I have an Audient ID22 which is equiped with this dacs and i couldn't find a single musician or sound engineer around me to tell that this box doesn't sound right, on the contrary they were quite pleased with it and in fact Audient ID22 had the best sales on Amazon in 2017, even better than RME and others.Nobody complains about how that thing is recording or playing.
 
You said about PCM1792 that is not quite right...
Well, I have an Audient ID22 which is equiped with this dacs and i couldn't find a single musician or sound engineer around me to tell that this box doesn't sound right, on the contrary they were quite pleased with it and in fact Audient ID22 had the best sales on Amazon in 2017, even better than RME and others.Nobody complains about how that thing is recording or playing.

The problem isn’t unique to PCM1792; I picked it because it’s a textbook example. It’s also of arguable importance. Almost every DAC that has an integrated linear phase OS filter, or external filter ASIC like DF1704, is not into the stopband by Fs/2 but Fs*0.536 (about 24 kHz for 44.1 sampling rate). Why is that an issue? Because the filters in the ADCs used to record almost all music do the same thing. This allows aliasing in the region of 20 kHz to 22.050 kHz if there is any signal content between 22.050 kHz and 24 kHz after the analog filter preceding the ADC.

This is the original point I was trying to make (incorrectly) in my reply to Hans, as it’s more applicable to ADCs and filters that perform decimation like 3lites. It would be best to have a filter in the DAC that is in the stopband earlier, much closer to 20 kHz if you want to get rid of the aliased region that came out of the ADC.


You can see from the graphs on the first page that 3lite did it all correctly :).
 
Last edited:
I don't want to make some principal case of who's wrong or who is right, but I give it one more final attempt.

Could you explain how any frequency can fold back when the DAC is outputting the signal with the same frequency as the digital filter.
Downfolding or aliasing can only happen when you downsample after filtering like in a studio where Audio is recorded at 384kHz and after digital filtering is down sampled to 44.1Khz.
Or is that what also happens in your filter, in that case you are right.
But if not, if you apply a digital filter or not, as long as the DAC is operating at the same speed, the analoque signal will be exactly like the digital content, but with many mirrors around Fs and convoluted with a Sinc function.
With no digital filter you will have the same performance as a NOS Dac with many ultra sonic mirrors, and in case of a digital filter most primary mirrors will be removed, and a slow analogue filter will remove the mirrors around Fs resulting in a rather clean signal limited to ....kHz.


Hans


P.S. Thank you for the Audio DAC shapes link, a very interesting comparison.
And again, great respect for the filter you made, a colossal job well done.

You’re right, I knew what I wanted to say conceptually but got it wrong. Actually the funny thing is we both missed that this filter is basically a SSRC and does decimate, which made me right for the wrong reason.