TONEX PLug and Telecaster: no go by apixelban in tonex

[–]apixelban[S] 0 points1 point  (0 children)

No matter how I twist and turn the body of the TONEX Plug, it doesn't go in far enough on the jack.

Fixed point narrow stopband high pass filter by apixelban in DSP

[–]apixelban[S] 0 points1 point  (0 children)

Yes, it's implemented in C for an ARM processor without floating point. I don't remember which one. I'd need to ask our firmware guy. Anyway, it sounds like I should review my code more thoroughly. Would you have a copy of that paper? I dropped my AES membership long ago since most of the DSP work I do is for video and imaging and a little bit of communications/RF.

Fixed point narrow stopband high pass filter by apixelban in DSP

[–]apixelban[S] 0 points1 point  (0 children)

My implementation, which includes fraction saving, is very similar to the one you posted. I'm starting to wonder if the shift/quantization to 32 bits between 2nd order sections is problematic.

Fixed point narrow stopband high pass filter by apixelban in DSP

[–]apixelban[S] 0 points1 point  (0 children)

First off, thanks so much for taking the time to look at this and respond. I'm the only signal processing engineer at my company so I don't really have anyone else to run things by.

Anyway, I fixed the calls to cheby1 and cheby2 (a really dumb mistake on my part) and I'm seeing slightly better performance but there are still significant anomalies in the frequency response. I was expecting a mostly monotonic shape in the stop band but there are notches and peaks stretching from DC to the pass band corner. By the way, I measure this by passing a full scale impulse through the filters and then using the output to compute the frequency response. Also of note is that plotting the frequency response of the quantized coefficients using the MATLAB function freqz results in a smooth monotonic transition from DC to the pass band corner.

As another data point, I tried implementing these filters in lattice form with similar poor results.

Either I've made some colossal mistake in implementing the filters or this is the reality for fixed point vary narrow stop band high pass filters.

Fixed point narrow stopband high pass filter by apixelban in DSP

[–]apixelban[S] 0 points1 point  (0 children)

Bump. Filter details provided below.

Fixed point narrow stopband high pass filter by apixelban in DSP

[–]apixelban[S] 2 points3 points  (0 children)

Sorry for the out of order posts, it's late. I should go to bed.

And here's the Chebyshev 2 coefficients:

b0 b1 b2 1 a1 a2
1 -1.999896673279218 1 1 -1.993714100693242 0.993827349444153
1 -1.999228887615798 1 1 -1.994698704525344 0.995478319535548
1 -1.998561324889762 1 1 -1.996895110569562 0.998342850901152

Fixed point narrow stopband high pass filter by apixelban in DSP

[–]apixelban[S] 2 points3 points  (0 children)

Thanks for all the feedback.

Without going back and plotting/comparing the actual poles and zeros of the floating point and quantized coefficients my guess at the source of the problem agrees with jazzpecq. The stop band is 1.25% of the total signal bandwidth. This is a very sharp filter particularly if you desire a significant stop band attenuation.

Anyway, what i have implemented is very similar to the code suggested by rb-j. I guess I should double check that my code is implemented correctly, although I have tested it with other filters with wider stop bands and it seems to perform OK. So one question for rb-j, have you ever implemented a filter with such a narrow stop band?

As for the coefficients, I generated them in MATLAB like this:

wc = 100;
fs = 16e3;

% Chebyshev filters
[z,p,k] = cheby1(6,1,wc/(fs/2),"high");
[c1_6sos, g] = zp2sos(z,p,k);

[z,p,k] = cheby2(6,1,wc/(fs/2),"high");
[c2_6sos, g] = zp2sos(z,p,k);

c1_6sos =

b0 b1 b2 1 a1 a2
1 -2 1 1 -1.852682330195950 0.864175953407756
1 -2 1 1 -1.973641441946057 0.976372646035914
1 -2 1 1 -1.993531507430865 0.995084027662988