Filter brewing for the Soekris R2R

So has no practical meaning for building FIR filters, in other words.
No, at least not if you only look at FIR1 and upsampling, but in comparing to used FIR filters of others, which can be expected to use the larger numbers for marketing reasons ;)

On the the hand as soon FIR2 comes into play, this gets really a meaningful FIR filter of that length, a special one that can be decomposed in that way. Still you have not the general freedom of choice of coefficients, but benefits in implementation, and those combined filters (IFIR) may be slightly more than shape with FIR1 and get rid of the aliases with FIR2.
 
Last edited:
Disabled Account
Joined 2005
On the the hand as soon FIR2 comes into play, this gets really a meaningful FIR filter of that length, a special one that can be decomposed in that way. Still you have not the general freedom of choice of coefficients, but benefits in implementation, and those combined filters (IFIR) may be slightly more than shape with FIR1 and get rid of the aliases with FIR2.

I had a play with the interpolated FIR's and I can see that the classic filter behaviour you see in the data sheets for PMD100/200, SM5842/47, etc, etc can only be derived from this process. On the other hand these kind of composite filters are precisely the standard filtering that motivates people like John Swenson to pursue the type of filtering the DAM implements. So it may well be that IFIR is a step backwards not forwards.
 
Coming to the filter party rather late…

Finally updated the firmware and had a listen to some of the favourite filters of the last weeks.
As mentioned before I am a headphones guy only with my current setup being : netbook - DIYINK USB to I2S – DAM1021 – DCB1 buffer – Dynahi and F5 HA headamps into either Senn HD800(lightly modded) or Hifiman HE500. I am mentioning this because the DAM was considered unbearable with the Sennheisers by some.

While Hifiman and Sennheiser are two two different camps sonically both are very revealing phones… and while the stock filter is sounding a bit forward and dry in my chain it is nowhere near unbearable.

The new filters are a definite improvement though with the 1015_Kb16_BW being the best so far and to my ears. It is very balanced and natural while retaining all the minute details the DAM is able to deliver. My favourite music to evaluate new gear or filters usually is music with “natural” instruments like piano (i.e. Helge Lien Trio), but coincidentally I found that “electronic noise” is very well suited to test the filters. I tried this with Tim Hecker’s “The Piano Drop” from Ravedeath 1972… beautiful stuff where especially the opening passage is very well suited to judge the character of a filter… is it aggressive, or balanced, or too dull etc.

Anyway a tremendous effort, spzzzzzkt! :)
 
I had a play with the interpolated FIR's and I can see that the classic filter behaviour you see in the data sheets for PMD100/200, SM5842/47, etc, etc can only be derived from this process. On the other hand these kind of composite filters are precisely the standard filtering that motivates people like John Swenson to pursue the type of filtering the DAM implements. So it may well be that IFIR is a step backwards not forwards.
The DAM has a composite 2-stage IFIR filter system (upsample, FIR1, upsample, FIR2).
The advantage we have with the DAM is that there are only two stages and that the intermediate frequency is quite high.
This allows the approach, make the relevant-for-listening things with FIR1 and remove the FIR1 aliases with FIR2 ... however in case we get at the limits of the resources a genuine IFIR approach could squeeze out possibaly a little more.

Of cause a total one-step approach would be nice. But for the same total filter length we would need about 8-times more DSP resouces, so either a Spartan XC6SLX75 (+$100 + new PCB) or running the current FPGA at its maximum clock frequency (which would probably need a redesign of the power supply and masive cooling).
This illustrates why the IFIR was that popular with limited resources.
 
Disabled Account
Joined 2005
The DAM has a composite 2-stage IFIR filter system (upsample, FIR1, upsample, FIR2).

The filters I'm talking about are actually multi-rate filters. I wasn't aware of them when I was reading Pflaumers patent but have since discovered what they do. These use a decimation stage - which Pflaumer discusses in his patent - and upsampling and as far as I can see this is the way PMD100/200 SM5842/7 etc, etc achieve the end results that they do with limited taps.
 
Last edited:
The filters I'm talking about are actually multi-rate filters. I wasn't aware of them when I was reading Pflaumers patent but have since discovered what they do. These use a decimation stage - which Pflaumer discusses in his patent - and upsampling and as far as I can see this is the way PMD100/200 SM5842/7 etc, etc achieve the end results that they do with limited taps.

Have all the filters you've been implementing spzzzzkt been multirate/upsampling/interpolation filters?

I've been trying to understand the purpose of the digital filter in DACs - I was always under the incorrect presumption that the digital filter was an anti-aliasing/reconstruction filter. Turns out they're most often interpolation filters as part of an upsample process. An analogue LPF is still required on the output for reconstruction.

Please excuse my ignorance with the questions. I've been trying to keep up with this thread best I can and have been trying to learn on the matter of DACs and digital filters.
 
Last edited:
Disabled Account
Joined 2005
Have all the filters you've been implementing spzzzzkt been multirate/upsampling/interpolation filters?

I've been trying to understand the purpose of the digital filter in DACs - I was always under the incorrect presumption that the digital filter was an anti-aliasing/reconstruction filter. Turns out they're most often interpolation filters as part of an upsample process. An analogue LPF is still required on the output for reconstruction.

Please excuse my ignorance with the questions. I've been trying to keep up with this thread best I can and have been trying to learn on the matter of DACs and digital filters.

These are straight reconstruction filters.

This is what the ever reliable Wikipedia has to say:

The sampling theorem describes why the input of an ADC requires a low-pass analog electronic filter, called the anti-aliasing filter: the sampled input signal must be bandlimited to prevent aliasing (here meaning waves of higher frequency being recorded as a lower frequency).

For the same reason, the output of a DAC requires a low-pass analog filter, called a reconstruction filter - because the output signal must be bandlimited, to prevent imaging (meaning Fourier coefficients being reconstructed as spurious high-frequency 'mirrors'). This is an implementation of the Whittaker–Shannon interpolation formula.

Ideally, both filters should be brickwall filters, constant phase delay in the pass-band with constant flat frequency response, and zero response from the Nyquist frequency. This is given by a filter with a 'sinc' impulse response.

While in theory a DAC outputs a series of discrete Dirac impulses, in practice, a real DAC outputs pulses with finite bandwidth and width. Both idealized Dirac pulses, zero-order held steps and other output pulses, if unfiltered, would contain spurious high-frequency content when compared to the original signal. Thus, the reconstruction filter smooths the waveform to remove image frequencies (copies) above the Nyquist limit. In doing so, it reconstructs the continuous time signal (whether originally sampled, or modelled by digital logic) corresponding to the digital time sequence.

"Ideal" in the Platonic sense of being the perfect model, whereas the reality at 44.1kHz is that you get something that somewhat imperfect.

So what FIR1 and FIR2 are doing are effectively filtering imaging above nyquist to a greater or lesser extent - although NOS complete abandons this goal.

FIR1 addresses the images above nyquist frequency of the original audio.
FIR2 addresses imaging around nyquist of the first upsampling process, so either 176.4kHz or 192kHz.

The analog LP filter has a corner frequency of around 212kHz, so has fairly limited influence. I believe the main purpose is to remove switching noise from the shift registers.
 
These are straight reconstruction filters.

This is what the ever reliable Wikipedia has to say:



"Ideal" in the Platonic sense of being the perfect model, whereas the reality at 44.1kHz is that you get something that somewhat imperfect.

So what FIR1 and FIR2 are doing are effectively filtering imaging above nyquist to a greater or lesser extent - although NOS complete abandons this goal.

FIR1 addresses the images above nyquist frequency of the original audio.
FIR2 addresses imaging around nyquist of the first upsampling process, so either 176.4kHz or 192kHz.

The analog LP filter has a corner frequency of around 212kHz, so has fairly limited influence. I believe the main purpose is to remove switching noise from the shift registers.

Thanks for response spzzzzkt. Does the analogue LPF also smooth out the step waveform (from zero order hold)?

Also is it worth fiiltering to mitigate for the sinc() roll off in the DAC output? Or is it negligible due to upsampling? I haven't really read of any DACs mitigating against sinc() roll off?
 
Last edited:
Disabled Account
Joined 2005
Thanks for response spzzzzkt. Does the analogue LPF also smooth out the step waveform (from zero order hold)?

Also is it worth fiiltering to mitigate for the sinc() roll off in the DAC output? Or is it negligible due to upsampling? I haven't really read of any DACs mitigating against sinc() roll off?


no, the analog filter will not help smoothing - corner frequency is 212KHz so will have virtually no effect on audio.

The only time sinc roll off appears to be an issue is with NOS, and in that case it appears to be a feature not a problem ;)
 
Thanks for response spzzzzkt. Does the analogue LPF also smooth out the step waveform (from zero order hold)?

Also is it worth fiiltering to mitigate for the sinc() roll off in the DAC output? Or is it negligible due to upsampling? I haven't really read of any DACs mitigating against sinc() roll off?
The DAM is switching with a frequency fd=64*44100Hz ~ 2.8MHz. With the digital filters you can control anything below fd/2, so anything audio relevant.
The output of the DAM is a step function (without the output capacitor), i.e. zero order hold, with step length 1/fd. Thus the hardware induced "sinc attenuation" at 20kHz is only 20 log(sin(pi 20kHz/fd)/(pi 20kHz/fd)) ~ 0,0007dB, so can be neglected.
The 1/fd steps are smoothed by the analog filter see the picture here:

After thinking longer...
P.S. The conclusions in the linked post are not all correct and corrected by me several posts later.
 
The DAM is switching with a frequency fd=64*44100Hz ~ 2.8MHz. With the digital filters you can control anything below fd/2, so anything audio relevant.
The output of the DAM is a step function (without the output capacitor), i.e. zero order hold, with step length 1/fd. Thus the hardware induced "sinc attenuation" at 20kHz is only 20 log(sin(pi 20kHz/fd)/(pi 20kHz/fd)) ~ 0,0007dB, so can be neglected.
The 1/fd steps are smoothed by the analog filter see the picture here:


P.S. The conclusions in the linked post are not all correct and corrected by me several posts later.

Awesome response zfe. Confirms a few things in my understanding.

So at this point it's really about coming up with good interpolation samples? The filtering of aliases is straightforward in comparison due to the upsampling process pushing images far apart?
 
Messing around with my picoscope.... :confused:
Doing some square wave analyses direct from the unbuffered outputs of the dam using some of my favourite filters. :D
For the time being using only 1khz squarewave and volume control. Some filters reach clipping already at V=1. At V=0 they all seems ok.

These are the filters tried. The images are in this order.
1021filt_1013_C180_MP
1021filt_1015_C150_BW
1021filt_1015_Kb16_BW
bamb_comb
new_nos

Nothing surprising here it seems :)

BTW: I am quite novice here....
 

Attachments

  • 1021filt_1013_C180_MP_V0.PNG
    1021filt_1013_C180_MP_V0.PNG
    83.1 KB · Views: 421
  • 1021filt_1015_C150_BW_V0.PNG
    1021filt_1015_C150_BW_V0.PNG
    76.3 KB · Views: 419
  • 1021filt_1015_Kb16_BW_V0.PNG
    1021filt_1015_Kb16_BW_V0.PNG
    76.5 KB · Views: 415
  • bamb_comb_V0.PNG
    bamb_comb_V0.PNG
    71.9 KB · Views: 398
  • new_nos_V0.PNG
    new_nos_V0.PNG
    65.7 KB · Views: 397
Disabled Account
Joined 2005
This has been sitting unposted for a couple of hours so not quite as timely as it was when written...


The main SINC roll-off issue appears to be after the final upsample.
Sinc roll-off is such that the response will be -0.1dB at 0.17*nyquist.

For the DAM this is 1411200*0.17 = 239904Hz

Completely unrelated but worth checking out...

POLARITY

I was wondering why the heck the DAM was sounding unfocused after it's rebox, recap, and reop-amp ordeal. I happened to listen to a sound staging test track which then continued on to a polarity check. Normal polarity sounded a bit diffuse, whereas inverse polarity sounded focused. I'll have to double check that I've hooked up the output jacks correctly when I did the rebox. For the moment A+ "invert polarity globally" option is doing the trick.

TBH I was a bit surprised at how much difference the polarity flip made.

There is some interesting speculative discussion on the polarity issue on the AudioGeorge website...
www.audiogeorge.com
 
Last edited:
Disabled Account
Joined 2005
So at this point it's really about coming up with good interpolation samples? The filtering of aliases is straightforward in comparison due to the upsampling process pushing images far apart?

Upsampllng does not push images apart. Images still occur around fs/2 of the original audio.

This is how a NOS filter behaves with 44.1kHz upsampling x8
attachment.php


The source file has two -6dB sine waves at 1kHz and 19kHz. You can see the images mirroring at 22.05kHz (fs/2) intervals.
 

Attachments

  • NOSx8.png
    NOSx8.png
    157 KB · Views: 521
Upsampllng does not push images apart. Images still occur around fs/2 of the original audio.

This is how a NOS filter behaves with 44.1kHz upsampling x8
attachment.php


The source file has two -6dB sine waves at 1kHz and 19kHz. You can see the images mirroring at 22.05kHz (fs/2) intervals.

Hmm I always thought that was the advantage of upsampling!!? You're throwing my world view into a spin... Hmmm..

I have a paper here from analog devices that describes separation of aliases with upsampling - http://www.analog.com/media/en/training-seminars/tutorials/MT-017.pdf

Have I misunderstood something?

Oh wait, you showed a graph for NOS upsampling which is just zero padding right? With no interpolation so that's not true upsampling is it? Genuine questions btw I'm still learning. Great I can discuss this stuff with you guys.
 
Last edited:
This has been sitting unposted for a couple of hours so not quite as timely as it was when written...


The main SINC roll-off issue appears to be after the final upsample.
Sinc roll-off is such that the response will be -0.1dB at 0.17*nyquist.

For the DAM this is 1411200*0.17 = 239904Hz

Completely unrelated but worth checking out...

POLARITY

I was wondering why the heck the DAM was sounding unfocused after it's rebox, recap, and reop-amp ordeal. I happened to listen to a sound staging test track which then continued on to a polarity check. Normal polarity sounded a bit diffuse, whereas inverse polarity sounded focused. I'll have to double check that I've hooked up the output jacks correctly when I did the rebox. For the moment A+ "invert polarity globally" option is doing the trick.

TBH I was a bit surprised at how much difference the polarity flip made.

There is some interesting speculative discussion on the polarity issue on the AudioGeorge website...
www.audiogeorge.com

Polarity is very important.

Credit goes to Clark Johnsen for "discovering" its importance (while listening to John Lennon's last record). He wrote a book discussing why this makes a difference: THE WOOD EFFECT. I am glad to say I have an autographed copy.

JPlay allows polarity change but it is very awkward. Are you saying there is a way to switch polarity within the SOEKRIS DAC? Please explain how to me. JPlay requires that you pause the play and access a control panel. With LP playback I was used to switching while the recording is playing and I would rather have that ability again. This is great news!

I have found there is ALMOST always a best setting for every recording. Clark found a recording where the polarity switched every track. It was a Japanese CD and he figured the engineers did this so at least half the tracks would sound good for everyone.

Many times in the past I had dismissed a recording as unlistenable only to find, once I had this facility, that it was not so bad after all. It can make a big difference on many recordings and a worthwhile difference for most of the others.

If this can be switched easily this is a REALLY BIG DEAL!
 
The advantage of upsampling is that you are now able to handle the images (the first ones) with digital filters, not analog ones. This allows then to use very simple (if any) analog filters to remove the remaining images.

I agree - I thought upsampling pushes the aliases apart (centred around new Fs) which allows you to design and implement a simpler analogue filter. I.e. the cutoff band/steepness no longer needs to be as strict as the aliases are 'further away'.