Jump to content
IGNORED

On the subject of "ringing"


semente

Recommended Posts

37 minutes ago, adamdea said:

I think the second formulation is more helpful. The talk of gaps in tracks is confusing 

 

It really can happen in the middle of a track. And since you can't ever have complete silence it follows that it does not need to be a series of zero value samples before the impulse. There must be a threshold below which it is buried in the noise. I'm not sure whether that means there is no pre-ringing or merely that it is disguised. Certainly though we know that the front half of the filter is not just creating spuriae it is reconstructing signal.

 

Is there any way of generalising when the linear phase filter will create pre-ringing? Clearly there needs to be spectral content in the transition band of the filter.  But is there no pre-ringing when it is in not visible, or is it just disguised/buried?  It seems that there must be pre-ringing when there is spectral content in the transition band of the transient event but no such spectral content before the transient (so that the effect of the filter must be spurious), but what if there is? 

 

In any event, the $64,000 question for me is whether even if we could hear pre-ringing it could possibly account for the sense a lot of people have that somehow conventionally produced 16/44 was not enough and that other things sound better. As far as I can see the whole pre-ringing conjecture was borne out of desperation because it is the only real "problem" which can be identified with the original 16/44 spec once implementation issues are taken out of the equation. Now the problem for me has always been that what people claim to experience with higher resolution tracks (or alternative filtering strategies for 16/44)   just does not seem to map to the circumstances in which ringing really does occur. A load of ancient tracks with no hf signal worth mentioning were reissued as sacd. Many piano recordings have sod all hf either. 

 

The possibility that people can detect the ringing in some recordings at some moments is IMHO entirely beside the point if ringing cannot account for claims which are made. 

Hi,

In the middle of a track, then there are gaps - but this will be noise, which is as good as zero's. The castenet example shows this. The ringing occurs when there is a sudden change in the signal, but once thie signal is operating at similar levels etc., then this ringing decays and we are left with the sound only.

 

I calculated the difference between the filter input and the filter output - and the ringing only occurs at the beginning of the transient. First figure is the input :

image.thumb.png.a5567c9119d7a4f8958fd1f7f0138e31.png

 

Second figure is the output of the filter :

image.thumb.png.9979716c6cdbf2bc48e2aca31d47495f.png

If there are frequencies inthe transition band, then in the steady state of the filter - then these transition band frequencies are attenuated, and do not cause ringing, unless they are the start of a transient.

 

Here is a frequency sweep with the attenuation at half the frequency sweep values 100Hz to 20kHz, filter set to roll off at 10kHz.  First figure you cannot see the sine wave sweep :

image.thumb.png.6d71e0dd9c9a7da297dfec5d20a2dc0c.png

Second figure is the attenuation of the sweep after it has passed through the filter :

image.thumb.png.eb82b0bd083f8903567b245161e00694.png

The next figure is zooming in on the transition band - no ringing, just attenuation of the signal since the filter is operating in its steady state :

 

image.thumb.png.13d2e1e87204b4e146d59d26e5024ed8.png

Regards,

Shadders.

Link to comment
1 hour ago, adamdea said:

In any event, the $64,000 question for me is whether even if we could hear pre-ringing it could possibly account for the sense a lot of people have that somehow conventionally produced 16/44 was not enough and that other things sound better. As far as I can see the whole pre-ringing conjecture was borne out of desperation because it is the only real "problem" which can be identified with the original 16/44 spec once implementation issues are taken out of the equation. Now the problem for me has always been that what people claim to experience with higher resolution tracks (or alternative filtering strategies for 16/44)   just does not seem to map to the circumstances in which ringing really does occur. A load of ancient tracks with no hf signal worth mentioning were reissued as sacd. Many piano recordings have sod all hf either. 

 

The possibility that people can detect the ringing in some recordings at some moments is IMHO entirely beside the point if ringing cannot account for claims which are made. 

Hi,

To continue - after pasting the figures, difficult to read what you have written.

 

I am not sure if one can hear pre-ringing etc. Also, post ringing occurs - but the scale is dependent upon the audio track. A slowly decaying track does not visibly exhibit ringing, compared to the castanets start transient.

 

Even for old tracks, passing through a linear phase filter, will exhibit ringing due to transient nature of the signal.

 

A transient should be defined as an abrupt change in the signal, and does not have to be a high frequency signal, but it is the instant change that causes the transient response of a filter. Here is a 1kHz sine wave sampled at 192kHz, and the filter cut at 95kHz.

image.thumb.png.d9a4d620db83ff1ef571d535b2464f9f.pngimage.thumb.png.02de867f09f8e335a7b760910c3a1f6c.png

As can be seen, even the start of a sine wave at 1kHz, energising a filter with a cut off frequency of 95kHz, causes ringing. The second graph is the post ringing of the 1kHz sine wave.

 

Regards,

Shadders.

Link to comment
3 minutes ago, Hifi Bob said:

Gaps are not necessary to show ringing, just content at the cutoff frequency.

Here is a ringing by steep lowpassing a continuous swept sine:

 

sox -n -n synth 1 sin 0:24k gain -1 sinc -t 10 -12k spectrogram -hwk
 

 

spectrogram.png

Hi Hifi Bob,

I am not aware of the SoX operation at the moment. Is the sweep a continuous sweep based on the frequency undergoing a constant rate of change, or is it a stepped frequency sweep ?

Is it possible to output the response of the filter to a file for examining ?

Regards,

Shadders.

Link to comment
2 minutes ago, Shadders said:

Hi,

To continue - after pasting the figures, difficult to read what you have written.

 

I am not sure if one can hear pre-ringing tc. Also, post ringing occurs - but the scale is dependent upon the audio track. A slowly decaying track does not visibly exhibit ringing, compared to the castanets start transient.

 

Even for old tracks, passing through a linear phase filter, will exhibit ringing due to transient nature of the signal.

 

A transient should be defined as an abrupt change in the signal, and does not have to be a high frequency signal, but it is the instant change that causes the transient response of a filter. Here is a 1kHz sine wave sampled at 192kHz, and the filter cut at 95kHz.

image.thumb.png.d9a4d620db83ff1ef571d535b2464f9f.pngimage.thumb.png.02de867f09f8e335a7b760910c3a1f6c.png

As can be seen, even the start of a sine wave at 1kHz, energising a filter with a cut off frequency of 95kHz, causes ringing. The second graph is the post ringing of the 1kHz sine wave.

 

Regards,

Shadders.

I'm not sure you are correct about that.

If there is no spectral content the filter is not energised.

 

I think you have created by taking a section of a sine wave is in fact a burst of hf energy. I'm pretty sure that a spectral analysis of whatever it is you have done will show this. This point is made by Dan Lavry in one of his old papers.

 

Another way of putting it is that that which is time limited cannot be band limited. So your abrupt change to what you think of as a 1Khz wave is not band-limited to 1KHz. 

 

You have to bear in mind that the old recording is pre-filtered through a microphone, tape machine etc . It really does not have that spectral information. So it will not contain whatever it is that you have done.

You are not a sound quality measurement device

Link to comment
1 minute ago, adamdea said:

I'm not sure you are correct about that.

If there is no spectral content the filter is not energised.

 

I think you have created by taking a section of a sine wave is in fact a burst of hf energy. I'm pretty sure that a spectral analysis of whatever it is you have done will show this. This point is made by Dan Lavry in one of his old papers.

 

Another way of putting it is that that which is time limited cannot be band limited. So your abrupt change to what you think of as a 1Khz wave is not band-limited to 1KHz. 

 

You have to bear in mind that the old recording is pre-filtered through a microphone, tape machine etc . It really does not have that spectral information. So it will not contain whatever it is that you have done.

Hi,

The graph shows that whatever the frequency of the signal, a transient will cause ringing. Here is a quick and dirty fft - i have not bothered to modify the axes, or mirror the response to show negative and postive energy :

image.thumb.png.a8feb1aba63f4da455fc48af0932eeee.png

As can be seen - this is a pure sine wave. There is no other energy in the signal.

 

The reason for the pre-ringing, is as stated before, the sine wave presents an abrupt change to the filter input. It is a transient, and creates a transient response from the filter in the form of pre-ringing and post-ringing.

 

Regards,

Shadders.

Link to comment
24 minutes ago, Shadders said:

Hi Hifi Bob,

I am not aware of the SoX operation at the moment. Is the sweep a continuous sweep based on the frequency undergoing a constant rate of change, or is it a stepped frequency sweep ?

Is it possible to output the response of the filter to a file for examining ?

Regards,

Shadders.

There are other options available, but that sweep was constant rate.

 

For the impulse response:

 

sox -n ir.dat synth 1s square pad .4 .4 sinc -t 10 -12k
 

The filter coefs will be in the 2nd column of ir.dat

 

Note: this is an ‘insanely’ steep filter—transition band of just 10 Hz.

Link to comment
1 minute ago, Hifi Bob said:

There are other options available, but that sweep was constant rate.

 

For the impulse response:

 

sox -n ir.dat synth 1s square pad .4 .4 sinc -t 10 -12k
 

The filter coefs will be in the 2nd column of ir.dat

Hi Bob,

Thanks - i have the SoX help file, but nothing in it about sweep frequency.

What i want to do is take the filter output and save to a file. So, how do i modify the following to output the data to a file :

 

sox -n -n synth 1 sin 0:24k gain -1 sinc -t 10 -12k spectrogram -hwk

 

Thanks and regards,

Shadders.

Link to comment

Ah,

sox -n output.wav synth 1 sin 0:24k gain -1 sinc -t 10 -12k

 

That gives an official, Microsoft WAV file, but some programmes don’t like it, in which case, try:

 

sox -n -t wavpcm output.wav synth 1 sin 0:24k gain -1 sinc -t 10 -12k

 

The sweep freq is given as ‘0:24k’ i.e. 0Hz = DC to 24 kHz. The colon specifies linear sweep. In the manual, in the ‘synth’ section, there are listed the other available sweep types.

Link to comment
9 minutes ago, Shadders said:

Hi,

The graph shows that whatever the frequency of the signal, a transient will cause ringing. Here is a quick and dirty fft - i have not bothered to modify the axes, or mirror the response to show negative and postive energy :

image.thumb.png.a8feb1aba63f4da455fc48af0932eeee.png

As can be seen - this is a pure sine wave. There is no other energy in the signal.

 

The reason for the pre-ringing, is as stated before, the sine wave presents an abrupt change to the filter input. It is a transient, and creates a transient response from the filter in the form of pre-ringing and post-ringing.

 

Regards,

Shadders.

I think you are arguing yourself round in a circle. This abrupt change thing has a mathematical meaning in terms of spectrum; it's just counter-intuitive.  I fiddled around with matlab some time ago to confirm this. If you are doing an fft make sure it takes in the silence beforehand as well as the signal.

I will leave it there but am quite happy to be corrected  by anyone with sound maths. 

You are not a sound quality measurement device

Link to comment
11 minutes ago, adamdea said:

I think you are arguing yourself round in a circle. This abrupt change thing has a mathematical meaning in terms of spectrum; it's just counter-intuitive.  I fiddled around with matlab some time ago to confirm this. If you are doing an fft make sure it takes in the silence beforehand as well as the signal.

I will leave it there but am quite happy to be corrected  by anyone with sound maths. 

Hi,

No, i am not arguing in circles.

OK - agreed - did not add the zeros before and after - here is the fft with zeros :

image.thumb.png.ead37ab7521ad298de2417068a7919f0.png

Energy spread about the 1kHz, but none at the transition band or cut off frequency, etc.

 

OK - any linear time invariant system when at rest, that is initial conditions at zero (as an example), when energised with a signal will have two responses. The transient response and the steady state response. The total response = [transient response + steady state response] .

 

Every DSP book covers this. As do electronic engineering systems analysis and synthesis books.

 

Regards,

Shadders.

Link to comment
1 hour ago, Shadders said:

 

I calculated the difference between the filter input and the filter output - and the ringing only occurs at the beginning of the transient. First figure is the input :

image.thumb.png.a5567c9119d7a4f8958fd1f7f0138e31.png

 

Second figure is the output of the filter :

image.thumb.png.9979716c6cdbf2bc48e2aca31d47495f.png

 

On this, this, are you sure it shows "ringing" and not something else?  Have you checked the input to make sure band limiting is proper?  Do you have a description of the filter properties?  Sorry if you already posted that - I'm having some following along with the different discussions/examples in this thread.

Link to comment
Just now, psjug said:

On this, this, are you sure it shows "ringing"?  Have you checked the input to make sure band limiting is proper so that aliasing is not showing up.  Do you have a description of the filter properties?  Sorry if you already posted that - I'm having some following along with the different discussions/examples in this thread.

Hi,

I used the fir1 filter command in Octave (butterworth linear phase), set the samples rate at 192kHz, and 1 second worth of data. The filter cut off was 95.04kHz, using 50 taps.

 

Added sine waves at frequencies of 1kHz, 10kHz, 20kHz, 40kHz, and 60kHz, all with preceding and post zeros - so they are separate and distance in samples between them is much greater than the filter length. I also concatenated them, to see the result of a CPFSK signal - which does incur ringing too at the frequency shifts.

 

Regards,

Shadders.

Link to comment
2 minutes ago, Shadders said:

Hi,

No, i am not arguing in circles.

OK - agreed - did not add the zeros before and after - here is the fft with zeros :

image.thumb.png.ead37ab7521ad298de2417068a7919f0.png

Energy spread about the 1kHz, but none at the transition band or cut off frequency, etc.

 

OK - any linear time invariant system when at rest, that is initial conditions at zero (as an example), when energised with a signal will have two responses. The transient response and the steady state response. The total response = [transient response + steady state response] .

 

Every DSP book covers this. As do electronic engineering systems analysis and synthesis books.

 

Regards,

Shadders.

I'm sure they do and I'm not disagreeing, but I think there is a reason for this which has a correlate in the spectral analysis. I can't make sense of your fft but it certainly doesn't look right to me. Putting this backwards if what you say is correct then it is possible to chage something in the time domain but not in the frequency domain which must be wrong. If the filter changes the output waveform in the time domain it must be changing its spectrum. But if there is no energy in or above the transition band then the filter can't be changing the spectrum. 

You are not a sound quality measurement device

Link to comment
6 minutes ago, Shadders said:

Added sine waves at frequencies of 1kHz, 10kHz, 20kHz, 40kHz, and 60kHz, all with preceding and post zeros - so they are separate and distance in samples between them is much greater than the filter length.

 

Ah - OK.  I thought this was a recording.  If you started and stopped the sine wave components abruptly, then these are not band limited, right?

Link to comment

If anyone wants to have a good laugh have a look here

https://hydrogenaud.io/index.php/topic,102630.0.htm

This thread 4 years ago on Hydrogen audio of me trying to get various people to explain to me what the effect of a time limiting a signal is. 

[I did eventually get octave/matlab to work and was able to verfiy that the effect of time limiting a signal is to make its spectrum unlimited! But the thread records only my pain)

As Saratoga says 

 "I think though what you really want to know is what happens if you take well known infinite functions (e.g. sin(x)) and transform them over a finite window.  In this case the window (say rect(x)) is multiplies by the function in the time domain, which means they're convolved in the frequency domain.  The result is that your delta function becomes a sinc function with width determined by the length of the window over which you sampled."

 

ie the spectrum of a time limited sine wave is equal to the spectrum of a sine wave convolved with the spectrum of a time domain rectangle ie a sinc function in the frequency domain. The wider the rectangle (longer the sampling interval) the narrower the main lobe. 

Thus any time limited signal must have unlimited spectral energy.  

 

That is why the time limited section of a sine function may pre ring.

 

mansr... amirite?

You are not a sound quality measurement device

Link to comment
21 minutes ago, mansr said:

Of course not. Any deviation from a pure sine wave creates additional frequency components.

 

37 minutes ago, psjug said:

Ah - OK.  I thought this was a recording.  If you started and stopped the sine wave components abruptly, then these are not band limited, right?

Hallelujah.I was beginning to wonder whether I was going mad. 

You are not a sound quality measurement device

Link to comment
1 minute ago, Shadders said:

Hi psjug, mansr,

Yes- but not at the transition band or other - the energy spreads about the 1kHz signal.

Regards,

Shadders.

I am not sure I understand what you are saying, but try this:

 

Run a FFT on your input.  Maybe you need to make a longer series by repeating the input series some number of times.  My tiny brain is overloading thinking about whether you need to make the series longer.  Anyway, you will then see the out of band components introduced by the instantaneous starting and stopping of the sine wave components.

Link to comment
Just now, psjug said:

I am not sure I understand what you are saying, but try this:

 

Run a FFT on your input.  Maybe you need to make a longer series by repeating the input series some number of times.  My tiny brain is overloading thinking about whether you need to make the series longer.  Anyway, you will then see the out of band components introduced by the instantaneous starting and stopping of the sine wave components.

Hi,

As above - close up of the sine wave spectrum - energy spread as stated.

Will run again with longer number of samples etc.

Regards,

Shadders.

Link to comment

Hi,

Rerun of the script but with only the 1kHz signal present, 192,000 samples, filter has 50 taps, 95.04kHz cutoff etc.

image.thumb.png.a6ab6affdf74a92620b3274111c6cab8.png

This is after the signal has been filtered.

FFT of the signal before filtering :

image.thumb.png.271e9d88b9318b89a77e6ed6cf743966.png

Slight difference in the energy spread, in my detail of the plot, not sure if it can be seen.

Regards,

Shadders.

Link to comment
41 minutes ago, Shadders said:

Hi,

Here is a zoom of the sine wave spectrum :

image.thumb.png.2b602a997d855f67f73fd0fc8c17bc08.png

As can be seen, not a perfect sine wave, but the energy is contained mostly about the 1kHz frequency.

Regards,

Shadders.

Mostly yes. But not entirely. That is the nature of a sinc function  -it goes on for ever. But it continues to infinity. It is an infinite spectrum. It is not band limited. So is there some energy in the transition band of the filter? Answer yes.

 

Listen this stuff is really complicated and I only dimply grasp it. I  am a pure amateur and had in the end to get Morrson on Fourier analysis to get my mind somewhat round it. But if you get the point that the frequency and time domains are interchangeable it kind of all flows. 

The reason a dirac has to have infinite bandwidth weirdly is precisely because it is zero at all points before and after the impulse. Maths thinks the zero is caused by the interaction of loads of sine waves which cancel each other out everywhere other than at the impulse event. It thinks the same about any other time limited signal 

 

In practical terms for audio it does not matter too much that all time limited signals have infinite bandwidth (at low amplitude) because the spectral leakage is pretty slight. 

 

Getting back to my point some time ago- if there is "no" spectral content in a recording [edit in the transition band of the filter] then it won't pre ring. I say "no" because well there alway is some

You are not a sound quality measurement device

Link to comment
4 minutes ago, adamdea said:

Mostly yes. But not entirely. That is the nature of a sinc function  -it goes on for ever. But it continues to infinity. It is an infinite spectrum. It is not band limited. So is there some energy in the transition band of the filter? Answer yes.

 

Listen this stuff is really complicated and I only dimply grasp it. I  am a pure amateur and had in the end to get Morrson on Fourier analysis to get my mind somewhat round it. But if you get the point that the frequency and time domains are interchangeable it kind of all flows. 

The reason a dirac has to have infinite bandwidth weirdly is precisely because it is zero at all points before and after the impulse. Maths thinks the zero is caused by the interaction of loads of sine waves which cancel each other out everywhere other than at the impulse event. It thinks the same about any other time limited signal 

 

In practical terms for audio it does not matter too much that all time limited signals have infinite bandwidth because the spectral leakage is pretty slight. 

 

Getting back to my point some time ago- if there is "no" spectral content in a recording then it won't pre ring. I say "no" because well there already is some

Hi,

I checked the numerical values of the plot you responded to - they are not zero - approximately 1/100th of the peak value. The plot just does not show it.

 

I have never stated anything does not follow the principles of the fourier transform.

 

I am not sure what you mean by your last statement, no spectral content mean no pre-ringing.

 

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...