Reply by robert bristow-johnson October 26, 20132013-10-26
On 10/25/13 1:56 AM, niarn wrote:
>> >> i like to define it as the dB of SNR plus the dB of headroom. > > That makes sense to me because the headroom could just as well be used to > gain up the input and thus increase SNR.
to a point. that's why i think you need to specify a decent mid-level output (like 6 dB below the rails is what i would suggest). but if you crank it up too high, you'll lose *both* headroom and SNR.
> One practical issue I can think of > with this approach is that if some non-stationary input is used for the > measurement it may be difficult to find or track what the headroom should > be. I assume you mean the margin up to fullscale as being the headroom.
yes. my nomenclature for "fullscale" is "rails".
> What type of input would you use for your SNR measurement? sweep, > sinusoidal, noise?
whatever. that's a spec. but to compare apples to apples, you need to account for that 1.76 dB you get from a sine wave compared to a signal that has uniform p.d.f. up to its maximum value. the margin between the maximum and the rail (or "ceiling" or "fullscale") is, by definition i think, the headroom. i like that uniform distribution (which you get with a triangle or sawtooth wave without DC) for the test signal because then there is no 1.76 dB factor (or any other) and the p.d.f. of the S (in S/N) is the same as the p.d.f. of the N (at least undithered N). and then you get a very clean formula for DynamicRange = (6.02 dB)*(word width in bits). if you use a sinusoid, you would have to add 1.76 dB. and if you use maximum-length sequences for the driving signal and you jacked that up to the rails, i think you get another 3.01 dB S/N more than the sine. but i would never recommend driving a system to the rails with an MLS. nor even a sine wave. just seems like asking for trouble. you may get distortion components in the D/A or something.
> >> these two >> quantities add roughly to a constant, at least for mid-level output. > > Do you mean that for mid-level output there is very little risk of internal > wraparound or saturation that could impact the measurement?
yeah, like 6 dB below the rails. but the SNR+HR should still be about the same if you're 12 dB below the rails (6 dB less SNR and 6 dB more HR). but you wouldn't want to make this measurement 6 or 12 dB above the LSB. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by niarn October 25, 20132013-10-25
> >i like to define it as the dB of SNR plus the dB of headroom.
That makes sense to me because the headroom could just as well be used to gain up the input and thus increase SNR. One practical issue I can think of with this approach is that if some non-stationary input is used for the measurement it may be difficult to find or track what the headroom should be. I assume you mean the margin up to fullscale as being the headroom. What type of input would you use for your SNR measurement? sweep, sinusoidal, noise?
> these two >quantities add roughly to a constant, at least for mid-level output.
Do you mean that for mid-level output there is very little risk of internal wraparound or saturation that could impact the measurement?
> > >-- > >r b-j rbj@audioimagination.com > >"Imagination is more important than knowledge." > > >
_____________________________ Posted through www.DSPRelated.com
Reply by robert bristow-johnson October 24, 20132013-10-24
On 10/23/13 8:56 AM, Detlef _A wrote:
> > Vlad's Filter has z-transfer function > > 1/( -16581375*(z^-3)+49938690*(z^-2)-50134528*(z^-1)+16777216) > > ans thus poles at > > 0.996078 +/- j*0.005513 > and 0.996094 > > THX for all the fun! >
boy, i wasn't gonna go through all that work. better you than me. thank you for your sacrifice. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by robert bristow-johnson October 24, 20132013-10-24
On 10/21/13 10:26 AM, Vladimir Vassilevsky wrote:
> On 10/21/2013 3:26 AM, niarn wrote: >>> Besides frequency response, look at dynamic range of the filter in the >>> passband and in the stopband. >>> >> >> Do you mean the level of the noise floor? >> How exactly do you measure the dynamic range? > > Dynamic range at the frequency = level of clipping at the frequency vs > noise density at the frequency. >
i like to define it as the dB of SNR plus the dB of headroom. these two quantities add roughly to a constant, at least for mid-level output. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by Detlef _A October 23, 20132013-10-23
Hi all,

Vlad's Filter has z-transfer function

1/( -16581375*(z^-3)+49938690*(z^-2)-50134528*(z^-1)+16777216)

ans thus poles at

0.996078 +/- j*0.005513
and 0.996094

THX for all the fun!

Cheers
Detlef	 

_____________________________		
Posted through www.DSPRelated.com
Reply by niarn October 22, 20132013-10-22
>Dynamic range at the frequency = level of clipping at the frequency vs >noise density at the frequency.
I have measured (simulated) SNR. Look here: http://tinypic.com/r/2cxvijc/5 The SNR should be related to your dynamic range measure as there is used a fullscale input. There is a 6 dB difference independent of frequency, it seems. Cheers _____________________________ Posted through www.DSPRelated.com
Reply by Vladimir Vassilevsky October 21, 20132013-10-21
On 10/21/2013 3:26 AM, niarn wrote:
>> Besides frequency response, look at dynamic range of the filter in the >> passband and in the stopband. >> > > Do you mean the level of the noise floor? > How exactly do you measure the dynamic range?
Dynamic range at the frequency = level of clipping at the frequency vs noise density at the frequency. Vladimir Vassilevsky DSP and Mixed Signal Designs www.abvolt.com
Reply by niarn October 21, 20132013-10-21
>Besides frequency response, look at dynamic range of the filter in the >passband and in the stopband. >
Do you mean the level of the noise floor? How exactly do you measure the dynamic range?
>Vladimir Vassilevsky >DSP and Mixed Signal Designs >www.abvolt.com > > >
_____________________________ Posted through www.DSPRelated.com
Reply by Vladimir Vassilevsky October 17, 20132013-10-17
On 10/10/2013 1:07 AM, niarn wrote:

> I can see that I also messed up the legend and colors in the plot. The > green curve is the response of the filter posted by VLV and the black curve > is the response of the other filter posted by me. If you want to verify for > yourself then maybe you can use this (It generates the plot).
Better: s32 LPF(s32 *z, s32 x) { x = z[0] += (x - z[0]) >> 8; x -= z[2]; x <<= 1; z[1] += (x - z[1]) >> 8; return z[2] += (z[1] - z[2]) >> 8; } Besides frequency response, look at dynamic range of the filter in the passband and in the stopband. Vladimir Vassilevsky DSP and Mixed Signal Designs www.abvolt.com
Reply by niarn October 10, 20132013-10-10
>Did you intend to put: > > return z[2]; > >? Thanks.
No, sorry I messed that up and thanks for pointing it out. It should be z[1]. I can see that I also messed up the legend and colors in the plot. The green curve is the response of the filter posted by VLV and the black curve is the response of the other filter posted by me. If you want to verify for yourself then maybe you can use this (It generates the plot). clear all fs = 44100; fc = fs/1400; [Bref,Aref] = butter(3, 2*fc/fs); [Href,Fref] = freqz(Bref,Aref,10000,fs); figure; semilogx(Fref,20*log10(abs(Href))) hold on; N =5000; impulse = [1, zeros(1,4999)]; z2s = zeros(size(impulse)); z0 = 0; z1 = 0; z2 = 0; k = 1/256; for c=1:N z0 = z0 + (impulse(c)-z0)*k; t = z0 - 2*z2; z1 = z1 + (t - z1)*k; z2 = z2 + (z1-z2)*k; z2s(c) = z2; end [Hi,Fi] = freqz(z2s,1,10000,fs); semilogx(Fi,20*log10(abs(Hi)),'g--') z1s = zeros(1,5000); z1 = 0; z2 = 0; z0 = 0; for i = 1:length(impulse) z0 = z0 + (impulse(i)-z0)*k; z1 = z1 + z2*k; x = z0 - z1 - z2; z2 = x*k + z2; z1s(i) = z1; end [H,F] = freqz(z1s,1,10000,fs); semilogx(F,20*log10(abs(H)),'k') legend('Butter','VLV','Other one') xlim([10 1000]) ylim([-60 1]) xlabel('Frequency [Hz]') ylabel('Magnitude [dB]') title('Frequency response comparison') _____________________________ Posted through www.DSPRelated.com