Jump to content
IGNORED

John Atkinson: Yes, MQA IS Elegant...


Recommended Posts

Hi,

Need to correct the data above - cut off frequency is at 24kHz - now assumed. I used the fir1 command which by default uses a Hamming window to generate the filter - this has some in band ripple, and has a response similar to a Chebyshev filter. There is no note in the help text online about the Nyquist frequency.

 

If you examine the online help for Remez :

https://octave.sourceforge.io/signal/function/remez.html

 

States "Frequency is in the range (0, 1), with 1 being the Nyquist frequency.". As such, setting the filter parameter to 0.25 equates to 24kHz. (Matlab uses 0.5 for Nyquist Frequency, from memory)

 

I attempted to use a Butterworth filter, but a bug in Octave for this command failed in creating a 512tap filter.

 

The power at 24kHz is -102.86dB and the peak in the ringing is -70.86dB. This means that the difference between the energy creating the ringing and the ringing is +32dB. The filter should have a gain of 1, whereas the gain is 1,000.

 

The ringing seems to be modulated - here are the plots of the fir1 with 512taps, and 1024taps.

image.thumb.png.7961f2e40a6a321bd6de8050b496fda1.png 512tap

image.thumb.png.8f8ca7b3a22a646f9dd7b386ea7cd4be.png1024 tap

The lower frequency humps/ringing seems to be at 1kHz - the input sine wave frequency. There is a possibility that Octave has a bug - but the energy/power at 1kHz is -57dB - and i would expect that this frequency range is the main contributor to the transient response seen in the graph.

image.thumb.png.57812506a64820b0340f11edd0591afa.png

Since the system is linear, then we can state that despite the ringing caused by the -102.86dB at 24kHz, that the response seen in graphs above are the transient response to the in band signals.

 

As such, even though a band limited signal does not generate ringing, it will generate a transient response as per the graphs. The transient response changes depending on the filter length, and will change depending on the filter type.

 

The Octave text previously posted will allow anyone else to examine - Octave is free - it is provided as free alternative to Matlab.

 

Regards,

Shadders.

 

Link to comment

Hi,

Ran a few calculations - each period of the sine wave at 1kHz has 192 samples with the sample rate at 192kHz. The filter length stores these samples, where 256tap will store 1 period, 512tap will store 2 periods, and 1024taps stores 4 periods.

 

The input signal has 2 1/4 periods before levelling, hence the reason for the 2 sine waves in the output for the large filters.

 

image.thumb.png.eeb5a61c3d1fa723e713c212ceb48772.png256tap

 

image.thumb.png.df62913bc0b185d003bdda5b72fbccb9.png512tap

 

image.thumb.png.d6957b458872f0701d5688037511fd4e.png1024tap

image.thumb.png.c2010353f6855ed6ebce4ae89becff87.png2048tap

 

So, the memory of the filter means that the stored input is added to the incoming input when there is a transient change - in this case a faster signal added to a slower signal.

 

I can see why MQA claim that the current filters smear. So maybe the concept behind MQA using smaller tap filters is a very good strategy. Their ability to store previous inputs (memory) is low, such that when transients occur in the music, that their distortion of the music is minimised.

 

Regards,

Shadders.

Link to comment
1 minute ago, Miska said:

 

Just remember to always look time domain analysis side by side with frequency domain analysis... It so common mistake to look at only one of the viewpoints and forget the other one, while the two are mathematically bound to each other.

 

All-pass filter will have perfect time-domain performance but completely imperfect frequency-domain performance. As an example, abstract step response has infinite frequency spectrum. Naturally something sampled at non-infinite sampling rate will have bandwidth capacity less than infinite, so the step cannot retain infinite frequency spectrum either. You will just need to decide what kind of response is acceptable from both frequency and time domain perspective.

 

Hi,

Yes - i posted the frequency spectrum for the 512tap earlier. This is about the transient response of a filter, not the steady state.

 

All measurements or frequency and phase plots etc., are discussed based on the filters steady state condition. Although my signal has out of band energy due to construction of the levelling of the sine to 1, it is the in band energy that causes the distortion of the output of the signal from the filter.

 

I understand that the input signal used is perhaps not real world - who would listen to it ?., but it was done to illustrate a point.

 

Not all that MQA is saying is wrong or should be dismissed. They have just not shared the detail. If there is little energy at the extremities of the audio, then why use a large tap filter with the "smearing" (MQA's words not mine) if you can relax the filter sufficiently and reduce the transient effects (smear) too. I think what MQA have done in this aspect, is quite ingenious.

 

Regards,

Shadders.

Link to comment
5 minutes ago, mansr said:

There's nothing surprising about this. A better filter doesn't do that:

shadders-filter.thumb.png.02daf64657e99351ee917d6b040a9643.png

Blue line is from the Octave code you posted above. Red is the same with only a change to the filter.

Hi,

Which filter did you use ?

I just ran 64 taps - and get a better response.

Regards,

Shadders.

Link to comment
33 minutes ago, mansr said:

fir1(500, 0.25, 'low', kaiser(501, 32))

Hi,

Thanks. So does everyone use the kaiser window ?.

 

EDIT : OK, just did a quick check, the values of the filter coefficients have a dynamic range from 2x10^-17 to 0.25. So not appropriate for fixed point arithmetic in IC's.

 

How would you implement this filter with similar performance using fixed point arithmetic ?

 

Is this an issue in DAC IC's from Texas, Cirrus etc. ???

 

Regards,

Shadders.

Link to comment
19 hours ago, mansr said:

Use enough bits.

Hi,

Not to labour the point, here is the worst case filter from the PCM1792 - Texas Instruments DAC :

image.thumb.png.98926be7ecbc25df1fef61c9b89c4051.png

Stop band attenuation (-100dB to -130dB) is not that good compared to the kaiser window method (-300dB) of filter design.

Regards,

Shadders.

Link to comment
14 minutes ago, crenca said:

 

That is how I understand it as well.  The "time to pass through the filter can only be as short as the minimum time for the frequency that takes the longest" as I understand it is technically called "latency", and the only folks who seem to worry about it are HT types who want perfect alignment of the sound with the image on the screen.  Perhaps I am missing something, but in an otherwise normal musical playback situation I don't believe latency matters (am I wrong?) 

 

"On paper" then, what is the argument for "minimum" phase filter?  Why would you want a filter that had the effect of causing the phase of the frequencies (varies by frequency - I believe upper frequencies are "delayed" compared to lower...or do I have this backwards?) to be misaligned?  The two arguments as I understand it are that you are (A)  using the phase misalignment of the filter to "correct" or counteract phase misalignment in some other part of the playback chain (e.g. caused by room or speakers).  Then there is (B), which is "ringing" and its alleged audible effects.  

 

For myself with my normal HP listening (A) should normally be a non-factor.  (B) is "played up" in Audiophiledom.  Thing is, as near as I can tell, with what we know about "good" filter design (anyone can point to a situation where ringing becomes audible in a extreme EQ adjustment, or a poor filter design, or an impulse that by definition is a "step" function outside of the audioband and thus "breaks" the filters normal behavior), it rests on dubious assertions.  

 

As someone upstream said so much attention is given to this phenomenon in Audiophiledom, this "transient" behavior.  Yet, as we all know Audiophiledom has a habit (indeed is built upon) the ghostly edge phenomenons where the small becomes the large technically (allegedly) and important to $sells$.  In other words, "ringing" while real in a sense, appears to be leveraged in the audiophile confidence game for its own ends.  What am I missing?

Hi,

From the miniDSP sweb site :

REW uses IIR filters, while Dirac Live uses mixed-phase filtering - in effect, a combination of IIR and FIR filters. FIR filters are more powerful than IIR filters, but more expensive to implement. See the app note FIR vs IIR filtering for information on the differences between these two different types of digital filter.

(https://www.minidsp.com/applications/digital-room-correction/dirac-live-vs-rew)

 

I have not studied this, but one aspect that immediately occurs is that to implement room correction in regards to amplitude you will be splitting up the audio band into many smaller bands - so the gain of each band can be modified to achieve an overall flat response.

 

The band pass filters will always have out of band energy applied to them - and this will always be in the hearing frequencies (20Hz to 20kHz).

 

Therefore filters with ringing are a bad idea - you will need filters with no ringing.

 

Someone else may be able to confirm this.

 

Regards,

Shadders.

Link to comment

Hi,

My point was - that splitting the audio band up into frequency bands, 20Hz to 100Hz, 100Hz to 200Hz, 200Hz to 400Hz, and so on, means that if each band pass filter has ringing, and it is the energy at the ringing frequency that causes the actual ringing, then each band pass filter will ring, and this ringing will be audible.

 

Whether the ringing in the upper edge of the band pass is cancelled out by the next band pass filters lower edge ringing, i do not know. (Assuming that they have the same cut off frequency......)

 

Regards,

Shadders.

Link to comment
1 minute ago, Jud said:

 

Not sure that is possible if implementing filtering in the audible range.  You would presumably want the filter to cut frequencies below and/or above the range, and would presumably be sending it frequencies at (as well as above and below) those cutoff points, else there'd be no reason for a filter.  If these things are true, then the filter is going to ring.  You can minimize the ringing by minimizing steepness, but that lets through more of the frequencies you don't want.  You can push more or all of the ringing energy to after the signal that excites the ringing by using intermediate or minimum phase filters, respectively.

 

Whether upsampling (or just sampling at sufficiently high rates) works to minimize or eliminate ringing in this circumstance is beyond my knowledge.

Hi,

Depends on the order of the filter - 8th order will have minimal ringing if linear phase, and even less effect if minimum phase ?

 

For room correction to work, the bands of the audio signal will have to be split up - so you will have band pass filters in the audio band 20Hz to 20kHz.

 

Regards,

Shadders.

Link to comment
1 hour ago, Jud said:

 

Didn't see anything I recognized immediately as relevant to room correction there. Could you explain further?

Hi Jud,

I had a quick read - they are using the proposed frequency response to generate a single filter. The response is likely to be the inverse of the room measurement.

 

From the matlab wedsite - seems to be the same example :

https://uk.mathworks.com/help/dsp/examples/arbitrary-magnitude-filter-design.html

FIR Modeling with the Frequency Sampling Method

This section illustrates a case where the amplitude of the filter is defined over the complete Nyquist range (there are no relaxed or "don't care" regions). The example that follows uses a single (full) band specification type and the robust frequency sampling algorithm to design a filter whose amplitude is defined over three sections: a sinusoidal section, a piecewise linear section and a quadratic section. It is necessary to select a large filter order because the shape of the filter is quite complicated:

 

The REW system etc., allows you to remove sections of the equalisation, such as bass frequencies that have been amplified (neighbours), and implement your required granularity for the spectrum modifications.

 

Regards,

Shadders.

Link to comment
13 minutes ago, mansr said:

A filter "rings" if the input has energy at its cut-off frequency. Everybody knows this. Your experiment confirms it in a roundabout way. For an experiment using an actually band-limited pulse, see my website: https://troll-audio.com/articles/filter-ringing/

Hi,

Can you post as an attachment the band limited pulse ?. (Fig 2).

Can you state the sample rate you used also ?. Thanks.

Regards,

Shadders.

Link to comment
7 hours ago, fas42 said:

 

To me, the madness is that everyone blames the recordings - their own playback rig is blemish free, and they use it to sort the "good" from the "bad" ... as in, my car allows me decide which are good, versus bad roads - if the suspension of the vehicle stops me going around a corner at a certain speed, well, it's the civil engineers who got it wrong, they should be punished for their misdemeanours ...

 

I find this idiocy of thinking annoying, and now and again I comment upon it - to redress the balance.

Hi,

The following may be of interest :

https://www.thedailymash.co.uk/news/lifestyle/man-who-got-surround-sound-looking-for-new-ways-to-piss-money-up-the-wall-20180830176831

Regards,

Shadders.

Link to comment
13 hours ago, mansr said:

You can create it yourself in Octave/Matlab using "kaiser(49, 35)" and pad with zeros as you see fit. The sample rate doesn't matter. Whatever you decide on, the pulse contains frequencies up to slightly less than fs/4.

Hi,

Can you detail the method you used to create the pulse as per Fig 2.

 

If you use the filter function to generate the a pulse - use the impulse response, then there are negative values - and your Fig 2 has no negative values. Using a pulse in the time domain to pass through the filter, then there is the ringing for the kaiser window you specified. Thanks.

 

Regards,

Shadders.

Link to comment
28 minutes ago, vl said:

 

Thanks for the correction.  I should rephrase what I wanted to say.  Given a brick wall filter set at the Nyquist frequency of the sampling rate being used, a signal with energy bandwidth ABOVE or AT the Nyquist frequency will both excite filter ringing.

Hi,

Isn't a frequency above the nyquist frequency, aliased into the pass band ?

 

[Given that the nyquist frequency is Fs/2]

 

Regards,

Shadders.

Link to comment
33 minutes ago, mansr said:

There appears to be some confusion here. When sampling a continuous-time (analogue) signal or subsampling a discrete-time signal, any frequencies higher than half the (new) sample rate will be aliased. For this reason, an anti-aliasing filter must be applied before (sub)sampling. This filter operates at the original, higher rate (or in continuous time). Its cut-off is typically set at or just below the new Nyquist frequency. Input frequencies below the cut-off pass through (mostly) unchanged, while those above are removed (heavily attenuated). Input frequencies at (or close to) the cut-off manifest as "ringing" in the output.

HI,

I wasn't paying attention to the thread - i assumed vl was talking about reconstruction of a digital signal at a lower Fs than recorded.

Regards,

Shadders.

Link to comment

Hi,

 

The kaiser window was used to generate a band limited pulse, which has the following time based form and spectrum :

image.thumb.png.ed56db142c736ffbe46dd169442b51f4.png image.thumb.png.913a9d89a2f3bb8353480dd983da2a64.png

The window method of filter creation was used to create a kaiser window filter with the following parameters : kaiser(501, 9) and kaiser(501, 32), both 500taps, which have a -100dB stop band and -300 stop band respectively. The filter cut off was 24kHz (0.25 for fs = 192kHz).

The spectrums of the filters were as follows :

image.thumb.png.48bbddcefca6f076d8c384560f6b2071.png    image.thumb.png.4a645ae6398a5619f1fb6f001e3493ba.png

The spectrum of the filter in PCM1792 DAC is as follows :

image.thumb.png.a015cb5383899b6ed2b9a715da07d5c2.png

The pulse was passed through the two filters, and the results were as follows :

image.thumb.png.de1882d6bb3cffeb8ed6f8f142ad45e0.png   image.thumb.png.628c695888a29c17ef69ca69939100c1.png

Using a log scale for the filtered pulse :

image.thumb.png.c9723ff13ab8358f3402532c16ef83cb.png   image.thumb.png.84c6e58dd9bfdfb023822a58d9a9ef1d.png

Each filter has a transient response, and the input signal greatest rate of change of the rate of change (second order) is where the pulse peak is approached. This can be seen as a pulse appearing at the relevant amplitude in the time domain, preceding the main pulse, and after the main pulse.

 

For the -100dB filter, the noise pulse is -120dB from the peak value of the pulse, and is inverted. Whether this can be heard is doubtful since it will always be below the threshold of hearing, and in a 16bit system is below the noise floor. Therefore, CD is unaffected by this transient behaviour.

 

A music signal is in general continuous, and whether the rates of change in the music can cause multiple noise signals which accumulate is unknown.

 

There is no smearing of the signal, since the difference of the input signal and the output signal is shown below :

image.thumb.png.0cc186ad7323b67af3e0393a4e0696fa.png

As can be seen, the difference signal has peaks which are the peaks in the filter output due to the transient nature of the input signal, and these pulses peak at -120dB.

 

Whether this transient effect can be heard in a 24bit system is unknown, but it certainly does not smear the input signal, it just adds noise.

 

Regards,

Shadders.

Link to comment
1 minute ago, esldude said:

And other than a very few extended response microphones the energy left at 40 khz to 48 khz in 96 khz sampling is though not zero very low in level.  There isn't anything to do much of any ringing.  Plus at those frequencies we aren't hearing that.  

Hi,

The statement was semi-rhetorical.  ?

 

There is no information at these frequencies, and so the claimed ringing does not exist in the ADC.

 

Also, the ringing is directly proportional to the power level at the relevant frequency in the audio, so the ringing is non-existent at the 80kHz to 96kHz level (again).

 

JA stated : "That unless the user of an A/D converter is prepared to accept the possibility of some aliased image energy in order to use an antialiasing filter that preserves the time-domain behavior of the original analog signal, the resultant digital data will have sinc-function content at the Nyquist frequency accompanying every musical transient. "

 

The filters used are linear phase - so why would there be a problem with time domain behaviour ?. No smearing (dispersion) as claimed. (question to JA)

 

The only issue is the downsample/decimation from 192kHz to 44.1kHz. But as mansr showed, that the effect of ringing is significantly reduced by using the kaiser window method for filter generation to below -200dB. This is a linear filter too - no dispersion.

 

There are transient effects, but these are not smearing issues - just noise added to the signal for those filters that have a higher stop band - such as -60dB (TI PCM5252) to -100dB. The TI PCM5252 has multiple filters where one is asymmetric or minimum phase. They seem to be similar to those used by MQA. The PCM525 also has a mini DSP on board.

 

Most DAC IC's allow the use external filters - so in any event, you can design your own - to exceed the DAC IC inbuilt filters.

 

So for CD playback, ringing is not an issue. For high resolution - ringing is still not an issue. Neither is smearing - it does not exist in the audio chain.

 

Regards,

Shadders.

Link to comment
5 hours ago, Jud said:

 

Just for clarification - In all I have read, "smearing" in the time domain and dispersion are two different things.

 

I have seen "smearing" and time domain distortion discussed in connection with ringing, especially pre-ringing, which a minimum phase filter with a slow rolloff is designed to avoid.  (If the rolloff begins too close to the "Nyquist limit," and/or does not cut sufficiently, the filter will be "leaky" and allow aliasing and imaging.)

 

A minimum phase filter is said to be dispersive (and thus has group delay), since the time for each frequency to pass through the filter is different.  I have not seen this written about either in terms of smearing or in terms of time domain distortion.  (It may be a time domain distortion, I just haven't seen it written about that way.)

Hi Jud,

If you examine the link :

http://www.aes.org/tmpFiles/elib/20180906/17501.pdf

The AES MQA paper on page 3 states blur and dispersion are the same thing :

 

"It is now widely accepted that one key benefit of higher sample rates isn’t conveying spectral information beyond human hearing, but the opportunity to tackle the dispersive properties of brick-wall filtering"

 

"When considering the frequency and time responses of an end-to-end distribution channel, we must bear in mind that time dispersion or ‘blur’ can build up through a cascade of otherwise blameless components "

 

Again, the ringing, if it occurs is directly proportional to the power in the signal at the specific frequency, and the ringing is always less than the power at the specific frequency. So for a 22.05kHz cut off frequency, then this ringing will be small for a lower stop band filter such as a -60dB stop band (linear phase). The ringing will be non-existent for a filter with a stop band of -200dB or greater. These type of filters are easy to implement and when used in the recording chain, a CD will not contain ringing.

 

The MQA paper refers to smearing as reference [57] on page 6. In the context of the MQA document, it only refers to smearing in terms of the capability of human hearing being able to discriminate between signal with 7uS difference. It does NOT state temporal blur is smearing. It NEVER states what smearing is in terms of the issues that MQA is to solve. It only discusses temporal blur == dispersion.

 

Smearing seems to be made up issue which is discussed in respect to MQA, but MQA have never stated it in their publication as an issue.

 

Regards,

Shadders.

 

 

Link to comment
6 minutes ago, Fokus said:

 

If this were true then Sinc(x) itself would not ring.

 

Hi,

My mistake, the ringing is reduced but only slightly - from -100dB stop band to -300dB stop band. The ringing is still proportional to the power level at the cut off frequency.

 

It was the other effects which was the transient noise which was reduced, where for a -100dB stop band the transient noise was at 1e-6, and for the -300dB stop band the transient noise was at 1.8e-16

 

Regards,

Shadders.

Link to comment
2 minutes ago, Miska said:

I would say that there's much more to digital filter sonic properties than just ringing...

 

When it comes to ringing, quite a while ago I did my own test recordings of purpose picked instruments at 192k and then converted those to 44.1k with various different filters and tools. It wasn't hard to have a real world case of transient attack filter pre-ringing introduced because the content reached much higher than 22.05 kHz.

 

But that is certainly not all that has to do with how some filter sounds like. And this is not something that would elude measurements. Certainly the differences are measurable too...

Hi,

Yes- as per my post :

 

There is a transient response to a band limited signal applied to a filter. That band limited transient response is easily shown using Matlab/Octave, where its amplitude is proportional to the stop band of the filter (the greater the stop band the less energy in the transient response). Too much focus on ringing which does not exist on CD's, whereas the CD will excite the filters transient response.

 

The current DAC IC's have a variety of filters, each with varying stop bands, so their transient response will differ. This is possibly what is heard when differences are experienced between filters - for 24bit recordings - but for 16bit - the transient response (noise) is below the noise floor.

 

Regards,

Shadders.

Link to comment
11 minutes ago, Miska said:

 

Certainly ringing exists on CD's and not enough attention is paid for that. But luckily that, as many other source filter problems is fixable by using apodizing filters for DAC, while non-apodizing ones will pass the source's ringing through as-is.

 

And no it is not below the noise floor, it certainly is clearly seen. If you look at levels of the impulse response rings (either linear or logarithmic level scale), it clearly fits in CD's dynamic range. To some extent it would be apparent even on 8-bit samples.

 

Hi,

I was not referring to ringing. (I should clarify, a well produced CD will not have, or introduce ringing).

 

There is a transient response to an in band signal which is not ringing. If you used Octave/Matlab, this can be seen. The effect can be reduced by using a high stop band filter, or a filter with more taps. (just checked a 500 to 200 tap filter, transient peak is 3x worse for the 200 tap filter).

 

Regards,

Shadders.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...