# Filter brewing for the Soekris R2R

#### zfe

No idea if this is useful, but they’re done to work with Matlab.
I. W. Selesnick and C. S. Burrus, Exchange Algorithms for the Design of Linear Phase FIR Filters and Differentiators Having Flat Monotonic Passbands and Equiripple Stopbands, IEEE Trans. on Circuits and Systems II, vol. 43, no. 9, pp. 671-675, September 1996.

These programs are for the design of symmetric FIR filters achieving specified Chebyshev errors in the stopband and a specified degree of flatness in the passband.

This seem to be, like METEOR, an implementaion for flat pasbands. The maximal flatnes is a property of the derivates at f=0 (quoting Wilkinson, who claims to do more than that).
In contrast to METEOR which uses linear optimization (strong but slow) here a idea of Vaidyanathan (1985 see references in he above paper) is used who describes how to use Parks-McClellan for that.
So here the chances are better to be able to produce longer filters.

Last edited:

#### TNT

Paid Member
I don't think it's 'off topic' to ask at this point a question about the real world context in which all these filters stand. If it is about perfect music reproduction in our listening room with this specific DAC how come that the calculations can be done without reflecting the reality of music recording and/or reproduction in the individual set ups? I use room correction (PEQ & physical traps) and some of these filters are powerful enough to throw off quite a bit of my otherwise perfect balance (crap series, MB3 for instance).
I can hear the tiniest difference between filters but shouldn't they keep the overall room balance untouched and only change the behavior of the DAC? I am only talking about what seems to be phase related not about amplitude/frequency which is always o.k. in my room no matter which filter. I use my analog system (vinyl) for cross checking my room response and it's predictable and reliable with all kind of recordings.
And how could filters which can throw off phase quite a bit (some create a deeper space like analog while others sound flat) ever reflect the real studio situation where much attention is given to keep the correct phase between tracks and on the other hand define the character of the mix in many positions by adding delay? What is the reference point for checking these filters and is there one at all? Or does it all boil down to individual taste in the end and nothing matters?

The industry has not chosen the DAC filter to be the point where one do personal adjustment to local situation and preferences. This is bass and treble knob territory. For you, its room correction. Its just when these projects and product scome along that we have been offered the possibility to tweak sound by altering this part of the system. We hear level differences around 0,2dB. Your room correction is far beyond that. The filters are in this 0,xx league. One reference point for the filter is to create the closest to the theoretically perfect filter and leave it at that. Personal adjustments is done elsewhere. On the other hand you could do a final phase correction adjustment of your whole system in DAM.

There are no rules really... not here.

//

#### spzzzzkt

This is a bit random but still sounds pretty decent.
It is a Nyquist Filter, so a little bit different to the previous filters.

Worth having a listen to.

#### Attachments

• 1021filtN3.skr.zip
2.8 KB · Views: 59
• 1021filtN3.txt
38.9 KB · Views: 46
• N3.png
14.9 KB · Views: 376
• N3fr.png
21.8 KB · Views: 375

#### zfe

This is a bit random but still sounds pretty decent.
It is a Nyquist Filter, so a little bit different to the previous filters.

Worth having a listen to.
Moreover it might worth mentioning that this filter retains all original samples.

#### DEQ+TheEnd

Nice find TNT. He do some explanation on that site in a way that made a dumb nob like me get one tiny step further into understanding. And I will find use of his Op-Amp filter app in a boom box project I have slowly evolving.

On the other hand Paul’s latest filter once again slam me to the floor telling me I’m not just a dumb nob, but plain stupid.
I try to plot all the filter posted just to see if I learn something from the plots and exercise doing them.

Code:
``````Header from text file
dam1021,44100,8,1,233,8``````

Text file has 323 coefficients where every 8. value is zero. I thought zero was a valid coefficient value? Anyway as a test I removed all lines with zero. Now I have 283 coefficients.

These plots confirm zero as a valid coefficient value. But then I’m not sure I understand number of coefficients in Paul’s header in the text file?

#### Attachments

• withZero.PNG
34.6 KB · Views: 354
• withoutZeros.PNG
28.9 KB · Views: 357

#### zfe

Nice find TNT. He do some explanation on that site in a way that made a dumb nob like me get one tiny step further into understanding. And I will find use of his Op-Amp filter app in a boom box project I have slowly evolving.

On the other hand Paul’s latest filter once again slam me to the floor telling me I’m not just a dumb nob, but plain stupid.
I try to plot all the filter posted just to see if I learn something from the plots and exercise doing them.

Code:
``````Header from text file
dam1021,44100,8,1,233,8``````
Text file has 323 coefficients where every 8. value is zero. I thought zero was a valid coefficient value? Anyway as a test I removed all lines with zero. Now I have 283 coefficients.

These plots confirm zero as a valid coefficient value. But then I’m not sure I understand number of coefficients in Paul’s header in the text file?

He enters the vallues in the header manualy and fliped the digits, the correct header is
Code:
``````Header from text file
dam1021,44100,8,1,323,8``````
See the 48kHz variant where it is correct.

#### nightsky

One reference point for the filter is to create the closest to the theoretically perfect filter and leave it at that. Personal adjustments is done elsewhere.
Got it! No rules, all individual taste, and the goal is to find the theoretically perfect filter. Thanks for the reply, TNT, I really appreciate it.
And as there is no industrial standard for DAC filters the sound of the 'theoretically perfect filter' could theoretically also change slightly from CD to CD because the ADCs used in the recording studios can use different calculations and filters in order to create the original digital data. No matter what we try as end user we still couldn't tell if it is a good or bad recording/mixing job of the audio engineer, if it is the carrier (CD,HiRes,), our system, or simply a better or worse combination of ADC-DAC filters that creates different reactions in us.

#### DEQ+TheEnd

You're probably correct. If we assume this is just Paul keeping us on the alert. And we assume mkrom use the first 233 coefficients the result are in some way interesting.

Someone with the skills to do text parsing with SoX (no not Simple Outline XML) should come to rescue.
In a perfect world we would then feed SoX a script parsing dam1021.txt and create plots for all the filters inside. Not only for visualizing, but to also do a sanity check on the file as mkrom does not implement any failsafe.
I believe it will prove to be very useful when we later on get options to select between 4 filters for each fs and more people start posting their favorite combination files.

Last edited:

#### spzzzzkt

You're probably correct. If we assume this is just Paul keeping us on the alert. And we assume mkrom use the first 233 coefficients the result are in some way interesting.
View attachment 475825 View attachment 475826
Someone with the skills to do text parsing with SoX (no not Simple Outline XML) should come to rescue.
In a perfect world we would then feed SoX a script parsing dam1021.txt and create plots for all the filters inside. Not only for visualizing, but to also do a sanity check on the file as mkrom does not implement any failsafe.
I believe it will prove to be very useful when we later on get options to select between 4 filters for each fs and more people start posting their favorite combination files.

Nope, I can be a bit numerically dyslexic at times.

I only listened to 44.1 for a short period and thought it sounded a bit odd Spent most of the evening listening to 48kHz which sounded pretty nice, and prompted the post, and the odd ball comment...

BTW the key feature of the Nyquist filters is the zero's. Rather than having vanishingly small 0.01-E-09 the coefficients are placed directly on zero axis. They are an integral part of the filter so leave them there.

BBTW I got sick of the missing filter functions in Octave and in a moment of weakness bought a "home" license for MATLAB plus Filter toolbox and DSP toolbox...

Corrected N3 filter attached.

#### Attachments

• 1021filtN3_corr.skr.zip
2.8 KB · Views: 69
• 1021filtN3_corr.txt
38.9 KB · Views: 56
Last edited:

#### spzzzzkt

Got it! No rules, all individual taste, and the goal is to find the theoretically perfect filter. Thanks for the reply, TNT, I really appreciate it.
And as there is no industrial standard for DAC filters the sound of the 'theoretically perfect filter' could theoretically also change slightly from CD to CD because the ADCs used in the recording studios can use different calculations and filters in order to create the original digital data. No matter what we try as end user we still couldn't tell if it is a good or bad recording/mixing job of the audio engineer, if it is the carrier (CD,HiRes,), our system, or simply a better or worse combination of ADC-DAC filters that creates different reactions in us.

A "theoretically perfect low pass-filter" is a well defined mathematical concept. It's not an arbitrarily chosen filter that someone considers to be perfect.

Last edited:

#### spzzzzkt

Moreover it might worth mentioning that this filter retains all original samples.

OK, finally clicked what the expression "retains all original samples" entails. The main peak of the filter is 0.125 so when scaled by x8 the co-efficent is 1.000 and the incoming audio data is passed untouched by this portion of the filter.

I need to work on the Nyquist approach as the roll off seems a bit high, and FIR2 might benefit from a similar filter.

#### TNT

Paid Member
A "theoretically perfect low pass-filter" is a well defined mathematical concept. It's not an arbitrarily chosen filter that someone considers to be perfect.

Haj, so des nee. (jap)

//

#### spzzzzkt

but this one goes to 11...

Following on from zfe's comments about the Nyquist filters retaining all the original samples I thought it might be an idea to follow with that line of thought...

To that end I've made a Nyquist FIR2 filter that has a similar curve to the previous revision of the FIR2. The gain on the FIR2 filters has been returned to x8 so that the peak co-efficent is scaled to 1.000 (0.125 * 8) to preserve the original samples.

Using the volume control will mean the samples are altered at the intermediate stage, but it's an interesting experiment none the less. More to the point it also sounds pretty good to my ears.

#### Attachments

• 1021filtNqF2.skr.zip
2.8 KB · Views: 79
• 1021filtNqF2.txt
43.7 KB · Views: 65

#### zfe

OK, finally clicked what the expression "retains all original samples" entails. The main peak of the filter is 0.125 so when scaled by x8 the co-efficent is 1.000 and the incoming audio data is passed untouched by this portion of the filter.

I need to work on the Nyquist approach as the roll off seems a bit high, and FIR2 might benefit from a similar filter.
That the main coefficient is (scaled) =1 is only the minor part of "retains all original samples".
The main thing is that all coefficients that are a 8,16,24,...- steps away from the center are zero. That guarantees that the 8-times upsampled signal convoluted with that filter contains at every 8-th position just the original sample.

Moreover this, "every 8-th coefficient is zero" (but one which is 1) is the only way to "retains all original samples" (with a 8-times upsampled signal).
If "that one nonzero" coefficient is not 1 you have the original samples in every 8-th position ... with some gain.

Last edited:

#### spzzzzkt

That the main coefficient is (scaled) =1 is only the minor part of "retains all original samples".
The main thing is that all coefficients that are a 8,16,24,...- steps away from the center are zero. That guarantees that the 8-times upsampled signal convoluted with that filter contains at every 8-th position just the original sample.

Moreover this, "every 8-th coefficient is zero" (but one which is 1) is the only way to "retains all original samples" (with a 8-times upsampled signal).
If "that one nonzero" coefficient is not 1 you have the original samples in every 8-th position ... with some gain.

Ahhh... OK, that makes sense. Thanks for the explanation for the dummies (me in other words)

#### oneoclock

The filter 1021filtNqF2.skr measure very well, and sounds great. It was a very good impulse response in dB, superior to the rest of filters impulse except NOS and sound very nice, no strident, no disturb.

I think is more interesting short filters that maintain the original samples and good impulse response better than huge attenuation above 22 kHz.

#### TNT

Paid Member
I'm at 1021filtN3_corr which I enjoy immensely. Vey nice and apparently even better things down the line

Thanks again spzzzzkt!

//

#### vuki

I think is more interesting short filters that maintain the original samples and good impulse response better than huge attenuation above 22 kHz.

Michael Pflaumer (of Pacific Microsonics & Berkeley Audio Design fame) thinks different: Filter for DAC patent

#### spzzzzkt

Michael Pflaumer (of Pacific Microsonics & Berkeley Audio Design fame) thinks different: Filter for DAC patent

You are assuming Mr. Pflaumer holds exactly the same views in 2015 as he did in 1999 when the patent was lodged.

BAD Alpha DAC's relegate the PMD100/PMD200* style filters to a second tier "for studio reference only" role - which is intended so users can check what the recording will sound like on "other DACs". That is a pretty good inidcator that Pflaumer is currently using a different kind of filter to that described in the patent.

* As the PMD200 product release is dated 1999/2000 I'd be fairly certain that the patent linked to is related to the filtering used in the PMD200.