Category: LX521

LX521: building the analog filter

The various components were not built in a linear fashion and the amp with two channels was completed before I started the Analog Signal Processing unit. About two years passed between the original amp with two channels plus the miniDSP2x4s for the Orions and the final version for the LX521.  My previous version of my DIY Orion PCBs (ASP board) worked really well, but the LX521 user group produced a PCB, a shopping list, a manual, and troubleshooting guide. I was apprehensive about the DIY route versus a ready-to-use design that had been rigorously tested and choose the latter; this is a decision I came to appreciate later when trouble shooting.

These ASPSs certainly do not fit in the amp enclosure where there is a noise risk, so I bought a small, separate enclosure. While my Siamese Catherine ate the manual of the new enclosure my new cats were given amplifier therapy, teaching them that amplifiers are friends and part of their natural environment. Meanwhile I suffered more self-induced problems by straying slightly from the path by wanting to have five channels.

So, the preamp can be either balanced or unbalanced and the ASP can take either signal. However, its output is an unbalanced connection. This is a small drawing of the ASP and the connections to the power amps following Hypex’ recommendations for an unbalanced output: a balanced cable has both its pin 1 and pin 3 to the signal ground and than happily continues as a balanced cable inside the amp enclosure. Internal and external shields go to the chassis grounds but at separate locations.

Now, I added five ASPs in a semi-spacious enclosure with additional internal cabling. The amp itself was already built and had five connectors for the pre-amp signal to run to the DSPs I wanted to have in the amp enclosure (the balanced miniDSP was shielded, so why not?). With the ASP I had only one connector so I used one XLR-6  connector per speaker and a five-core shielded cable. For some reason I started with an unbalanced cable to the XLR-6 OUT connector and ALSO tied pin 1 and pin 3 on the inside of the amp AND connected internal and external shields to each other at all locations where I could. I cannot really recall exactly why I thought it was a good idea and in hindsight this was also really unwise; I made an all-noise surround system and had to re-cable everything.

So the internal cables were replaced and I also made sure that the shield of an external cable was not directly connected to the shield of an internal cable. All four channels do share the same signal ground in the interlink, but soit, they do so on the ASP-side as well.

I later considered using a network cable; these have four individually shielded twisted pairs and form a much neater and smaller connection (despite the graphs showing “more cable”). I was worried about connecting the flimsy shield on a network cable to the connectors on the Hypex side and already built the XLR-6 cables. Cabling and connectors are a significant money sink that added many hundreds of Euro’s to the entire system already, so didn’t pursue this option.

So one signal cable/channel is a bit of a monstrosity with four signals, four signal grounds twisted into a single point, and the shields (pin 1) connected to lugs. The individual cables have lavish colour coding per channel and per speaker. This saved me on more than one occasion and heat-shrink tubing is cheap. I removed a bit of the anodized layer where connecting the shields to chassis.

A close-up of the cable (actually, this is in the amp, not the ASP) shows the universe has a sense of humour and tried connecting the sub signal to ground; this happened at the same moment when one signal connector got loose at an amp module for the other speaker, resulting in no sound in both forward speakers at the same time for the subs only resulting in a minor panic attack.

Top view of the final setup. The power connecting enters the chassis top left and runs to a Audiophonics mains trigger below the bottom-left power board; two power boards are stacked bottom-right, with the top board feeding the lower board.  At the bottom two Meanwell power-supply units are wedged in. The ASPs have their chassis grounds connected to the bottom plate (connected to safety earth at the mains in).

I was worried about running 230V and PSUs in the ASP enclosure but I could not find any audible effect of running the mains near the ASPs. Admittedly, there is a minute bit of hum coming from the speakers if you are very close to the mid drivers, but that is acceptable to me. The stacking system was made from polystyrene sheet and tubes from my modelling supply with the boards connecting to the chassis ground via some mounting pins (M3 thread).

LX521: introduction
LX521: deriving the digital filter
LX521: building the analog filter
LX521: building the power amp
LX521: building the speaker
LX521: results

LX521: deriving the digital filter

One additional challenge is the filtering for these speakers; these are active speakers with an elaborate filter; for the LX521 I certainly could not use the Orion filters. Adding a programmable Digital Signal Processing (DSP) unit would make sense.

I bought a small miniDSP 2×4 kit to experiment with, a a budget card with analog inputs and outputs. Digital filtering for audio is something I also know nothing about, but I do have some experience with signal processing of underwater radiated noise. This project came in handy for gaining some experience with acoustics and solving the speaker filtering, as from a mathematical point of view solving loudspeaker filtering is quite straightforward compared to sonar array processing. How to design a loudspeaker filter to produce the sound you want is something entirely different and a critical component of loudspeaker design, but these are supplied with the building plans so I only had to simulate the filter with freely available tools.

So, some technicalities. The analog filter is a combination of default ingredients and for the digital filter you have an equivalent; these filters are expressed in biquads, a simple parabolic expression. A filter transfer H is defined in biquad terms as

H=\frac{b_0+b_1z^{-1}+b_2z^{-2}}{a_0+a_1z^{-1}+a_2z^{-2}}

with z the complex transfer defined as

z\equiv e^{\frac{i2\pi f}{f_S}}

For the miniDSP implementation you divide all terms in H by a_0 and a_1 are a_2 negative, and you get

\^{H}=\frac{\^{b}_0+\^{b}_1z^{-1}+\^{b}_2z^{-2}}{1-\^{a}_1z^{-1}-\^{a}_2z^{-2}}

MiniDSP offers a great spreadsheet for all types of filter that could be easily moved into Matlab. For instance, for a second-order high-pass filter you have the following definition

a_0=\omega_p^2+\frac{\omega_p}{Q_p} +1
a_1=2(\omega_p^2-1)
a_2=\omega_p^2-\frac{\omega_p}{Q_p} +1
b_0=b_1=1
b_2=-2
with
\omega_p=\frac{2\pi F_p}{f_S}

so that depends only on the parameters Q_p, F_p and sampling frequency f_S. Some filters need more or different inputs so in the end you are only left with at most four inputs Q_p, F_p, Q_s, F_s, and the filter recipe. I added one additional term to shift the entire transfer by a gain G dB by multiplying all coefficients by a gain 10^{G/20}, and, a full phase inversion, (flipping the sign of b). Higher-order filters are simply the product of two lower-order filters. For instance, the 4th-order Linkwitz-Riley so predominantly present in the Orion and LX521 crossover is simply the product of two second-order filters. You can write the entire transfer more generally as

\textbf{H}=\prod\limits_{i=1}^N H_i

for all of the N components. Expressed in dB the total transfer is 20log_{10}|\textbf{H}|. But there is a catch.

This chart shows a collection of transfer functions of these Linkwitz-Riley filters (LR) for four different cross-over frequencies (i.e., different values F_p for and IIRC Q=\fraq{1}{2}\sqrt{2}). We have a several colors that represent the transfer for different sampling frequencies: black (f_S=\inf), blue (f_S=192 kHz), red (f_S=96 kHz), green(f_S=48 kHz). It is fairly obvious that the resulting transfer depends heavily on the sampling frequency the closer you get to high-frequency range.

One wonderful property of the LR4 filter is that the (complex) sum of the low pass and high pass components is constant and this property is retained in this DSP implementation. But the DSP I bought (the 2×4) has a sampling frequency of only 48 kHz. Translating an analog component by simply plugging in the design settings will not give you the correct transfer function. So I could be in trouble… I measured the 2×4 miniDSP response and it matches the theoretical transfer perfectly; it’s a property of the biquads and not the miniDSP.


Following some leads of other people on the OPLUG forum for an older Orion DSP implementation I added an equalization filter and managed to get the required transfer.

If you plot the settings of both high pass and equalization filter and you’ll notice the filter properties vary quite smoothly as a function of the cross-over frequency; at this point I though I could even generate a small formula to automatically get a reference crossover for a 48 kHz sampling frequency for both the high- and low pass filters.

However, when you fit filter components individually on amplitude only—here shown for a 7.5 kHz cross over in magenta—then the filter individual responses looks fine but the summed response is off by 2.5 dB. So, I went into full autist mode and over the course of a few weeks I made a small two-step fitting program to find the coefficients that minimizes the difference between the reference and DSP transfer function.

The first step is a genetic algorithm called NSGA-II that I implemented for our propeller optimization program (work), an approach where a number of function evaluations is performed using some selection of starting values for all parameters relevant within a predetermined box-constrained search range. From the results the best fits are kept and the worst fits are removed. The best fits are then pairwise combined; some parameters are exchanged and some changed a bit (crossover) and then some are randomly changed (mutation), mimicking the process of evaluation. The process is repeated a few times and generally the results improve with each step; until they do not. The optimization was constrained by demanding that the individual filters were always stable (there are criteria that can be easily evaluated); otherwise your response may be good in theory but the results are all static. Unfortunately the process is stochastic, meaning that you won’t find the same result each time you try and not all results are necessarily good.

In step two a Leverberg-Marquard gradient search approach was applied . This second step will continue from the best solution from the GA and homes in on the solution by testing the change in the total error for a change of each variable. The convergence can be slow but after a while you get error progression in the micro dB and then it is time to stop. After some testing running the GA 10 times and the gradient search no more than 2,500 times usually gave the same results for each run.

The combined approach proved to be useful. Some filters using a combination of the same filter types and if they have the same starting value the second step will always fail; the GA does not do that and provides an excellent starting point but not a good end point. I did spend a lot of time narrowing the search ranges manually in order to get it to work properly, learning about “machine learning”.

The animation shows an earlier attempt where each individual stage was fitted on both its phase and amplitude response; later I minimized the error in both the individual and summed amplitude transfer simultaneously and dropped the match with the phase: if the individual and summed amplitude responses are matched well then the phase differences will be matched automatically too. In the end I took the following approach for the entire cross-over that seemed to work well enough

  1. Simulate the entire cross-over in TINA, an analog filter simulator, exporting the (complex) response for each step of the filter of the Orion and the LX521.
  2. Pin down the ingredients of all stages of the cross-over for each channel separately.
  3. Fit the summed response, starting from the lowest frequency stage whereby the highest-frequency contribution was updated and the lower contribution kept constant. Only the lowest LF stage was not affected by the low sampling rate of this particular DSP so it made sense to start there.
  4. Implement the results in the 2×4 miniDSP and compare the measurement using the program ARTA with the expected response. This is a very use tool using your PCs soundcard’s line in/out to obtain the miniDSPs transfer.

So, this fitting procedure was certainly not a fire & forget exercise. Some stages needed to be fitted only for the response above -10 dB, some need a wider range or a restriction in the frequency range, the number of equalization filters and their search range needed careful attention and so on. For some starting points the second search algorithm would go insane and the calculated filter stability criteria were not always met.

This LX521 was more complicated to fit than the Orion with a few parallel notch filters that I could only fit with some trial & error. It was for these filters that you’d sometimes need a full phase inversion (that was very easily solved by setting a minus in front of the biquad expression). The transfers of the LX521 are proprietary information and cannot be shown , so I show only the error of the DSP implementation in dB. The green line is the individual error for each channel (3 total), the red line the error of adjacent channels and the blue line is the error of all summed channels. While the individual error can be large, these errors occur when the net contribution of that channel is very low as evidenced by the total response. The entire fit is within 0.05 dB except for a small dip at 15 kHz that I left unsolved.

Now, the miniDSPs 2×4 had a bit of a hiss that was not volume dependent. I wasn’t entirely sure how or why this happened, but for five channels I was hopeful that the 2×4 balanced edition would be more silent. I bought five and sold the normal versions. However, these DSPs proved to generate far more noise that was just terrible at the listening position.  I read up on chassis grounding for balanced connection, solving pin 1 problems, checking cables, “secret” jumpers on the miniDSP and reading up on the net. Many more people complain about noise from the balanced version and connecting it in as an unbalanced (!) version reduced noise considerably—which was indeed the case—but this was still much more that the normal 2×4 that was not really quiet either. MiniDSP didn’t respond to a support ticket so I decided to forgo the DSP entirely and this entire section was now all for nothing, except for an education experience.

LX521: introduction
LX521: deriving the digital filter
LX521: building the analog filter
LX521: building the power amp
LX521: building the speaker
LX521: results

Copyright © 2024 On The Slipway

Theme by Anders NorenUp ↑