Proffie Loudspeaker Output Stepdown to Line Level?

OK, I almost hesitate to ask this question as I’m kind of asking for the best wrong way to do something, but bear with me…

I’ve made a little adapter to fit to the end of a hilt that cuts the feed to the speaker and routes it out via a jack socket so I can plug the audio into an external sound system.

Of course this means I need to sort out the level discrepancy from the powered loudspeaker level to the line level signal needed for the external hardware.

I’ve tried it by simply turning the volume down to the minimum on the hilt buttons before connecting to the external sound system. The level in the config is 1900 max, and the prop gives 9 or 10 pips to lower the level.

This works OKish, but listening on a high end system, you can hear it’s still a little crunchy, and is still clipping slightly. In fairness, on saber sounds (swings, hums, clashes etc.) it’s barely noticeable, but on voice announcements or music tracks you can definitely hear it’s not quite there.

I could drop the level in the config further, but I’d prefer not to do that as I’m using a switched contact jack socket so that the hilt speaker takes over when you unplug the jack, so I want to keep a decent speaker level available on the hilt for running with the in-built speaker.

I realise this is a total fudge by its nature, so this might well be as good as it gets, but I’m wondering if there is a super-simple way to clear the final hurdle. For instance would simply adding a resistor to the positive line to the jack socket (but not the hilt speaker) sort it? And if so, what resistor value should I be looking at?

Thoughts welcome as always.

This has been asked quite a few times. Unfortunately I don’t have a great answer because I have never really tried doing this myself. My best guess is to do something like this:

This however assumes that the audio equipment filters out frequencies over 100kHz. Without that filter it’s always going to sound awful. A simple RC filter could be added to the above circuit to fix the output though. I’m not very good at designing analog circuitry, so I would probably get it wrong if I tried.

Of course, if you can use SPDIF instead, I highly recommend it.

One other option is to buy things that already do this. A combination of a ground-loop isolator and an in-line volume adjuster should work for almost anything. There are also things you can buy which take a speaker channel as input and produce line-level outputs. (Usually meant for when you want to install an amplifier in your car, but your car stereo doesn’t have a line out.)

I tried anyways.
If I’m correct (which I’m probably not) the addition of a 20nF capacitor in parallel with the 10-ohm resistor might be enough to filter out the high frequencies…
(Someone with a function generator and an oscilloscope should probably test that… oh wait, I have those things…)

How about adding a latching feature to the “little adapter to fit to the end of a hilt”
Then in the prop, you could have the EVENTID for latching on and off do a volume change?

@profezzorn can #define FILTER_CUTOFF_FREQUENCY be set in a prop, or is that not going to work at runtime?

I think the audio file are included before the prop file, so I don’t think it would work.

… but it turns out I don’t have the right capacitors … yet …

Been messing around some more with this…

Yesterday when I said it was clipping, that was listening through a full broadcast mixing console and monitor system in the control room I work in. (See pic). That’s about as high-end as it gets, and it was there that the clipping became evident. But of course, that environment is designed to show up every detail of the audio so that we operators working on the TV shows can hear problems and fix them before they get broadcast to the nation.

So I just tried adding a 100ohm resistor on the speaker positive line before the jack socket to drop the level further. And listening to that through headphones (high-end Audio Technica jobbies) and playing it through my home surround system (not at all high end, but movies sound pretty good through it) it actually now sounds OK, with no discernible clipping on music tracks or quotes which is where it was most evident before.

I’ve yet to try it at work again because I’m off until Monday, but I will try it then and report back.

I realise this is a total fudge, and unfortunately it does scupper my plans of having a speaker in the same pod that would get switched out when inserting a jack, because I can’t get the switched contacts to send the resistored version of the output to the jack but the unresistored version to the speaker. But I think on balance that’s a small compromise.

I’m also curious to see if you make any progress doing it ‘properly’ Prof. I think it would be a great feature. I know it feels like a step back taking it back to analogue, but It would mean you could run the line level into something like a radio microphone beltpack transmitter (via another adapter if necessary) to be received on a venue radio mic receiver system. The advantage of this over bluetooth is that radio mics are by necessity designed to be low latency in order to keep live lip-sync correct.

1 Like

You work on the Jeremy Vine Show?

1 Like

I do indeed, for my sins. :slight_smile:

I’m sure I can come up with something, although I am not an audio engineer, and I’m not great at analog circuits. Most likely, that means that what I come up with will work, but it might not be the simplest solution.

1 Like

Well, now I’m less sure.
I mean, I can come up with something, but it seems like a decent filter design requires active components (op-amps) which then requires input power, and suddenly, none of this is simple anymore.

Basically, to cut out enough of the ripple from the 400kHz PWM signal, a first-order filter RC filter is not enough. Seems like you need at least a second-order filter and possibly a higher order than that. Designing such a filter isn’t exactly complicated, but I’m not sure if it’s possible to do with passive components, as the impedance of each filter stage will change how the adjacent stages behave.

Standard practice seems to be to use op-amps in your filters so that each stage has high impedance. While it’s not super complicated, the op-amp will require power to work, and a handful of surrounding components, which would be a fairly un-satisfying solution. (too complicated)

Maybe I should focus on writing some code to make the onboard DAC work instead. It would just need some attenuation to hook up to an audio input.

Ahh, yeh - powered components do change the landscape somewhat, and as you say, the whole idea is to keep things simple. Looks like we may have hit a dead end.

However I’m curious - 400 kHz (400,000 Hz) is way above what we can hear, and I imagine is so high that even bucketfuls of it wouldn’t be able to move a speaker cone because the cone couldn’t move that quickly (or could it?). Which begs the question, in reality, does it need filtering out?

If the idea is to run the derived audio into some kind of sound system that will have been designed to handle the human hearing range of 20Hz to 20kHz give or take, then even if the hardware doesn’t expressly filter out other frequencies, I’m guessing it may well just ignore them given that they fall well outside said hardware’s design brief?

That said, I suspect these questions in themselves just show my ignorance, as I know almost nothing about PWM and how it works, and although I work in sound, I’m an operator rather than a full blown audio engineer. But the question just occurred to me given the numbers involved.

Maybe not, but, in general, when you sample a signal which has frequencies higher than the nyquist frequency (half the sample rate) then you get distortion, because the high frequencies get folded down and replicated into the frequencies that are below the nyquist frequency.

The solution to this problem is generally to put a filter before your sampler to remove as much of the frequencies above the nyquist frequency as possible before sampling. Since there is ~4 octaves between the PWM frequency and the nyquist frequency, a well designed filter should cut down the ripple from the PWM to nearly nothing. (-100db)

However, I can easily imagine a poorly designed piece of audio equipment which samples the input without any filtering, or with a poorly designed filter, and in that case, the PWM might completely overshadow the signal we actually want.

I can also imagine a completely analog system spending significant energy to amplify a 400kHz signal only to have it just generate a bunch of extra heat, the speaker cones are unlikely to replicate it. (And even if it did, only bats could hear it.) In this case the 400kHz signal might not be a problem, it would just be inefficient.

Of course, there may also be cases where luck helps, and crappily designed audio equipment simply fails to reproduce any of the distortion, even though it wasn’t designed to filter it out explicitly.

IMHO, for me to recommend a solution, it would have to produce the right output levels, and the PWM ripple should already be gone, because that’s the only way to make sure it works with most audio equipment.

1 Like

I replied on Facebook, but to add to this in context, I use a Line6 guitar transmitter, although I’ve only really done it once or twice and would need to put my engineer ears on to evaluate the actual quality. I know there’s no lag.


Brian, thas what ah’m talkin’ abou! :smiley: :+1:
That’s pretty much the same setup as I’ve built - speaker tails on a jst, then just fit a regular speaker or the jack socket output. And yeh, a guitar transmitter sounds like a great solution - I hadn’t thought of that!

Did you do anything else to make it work, like add resistors to the jack socket to drop the level?

And yeh, Prof, of course, I understand any recommended solution has to be completely sound (forgive the pun) from a full engineering standpoint to be endorsed. And as you say, audio equipment varies wildly in terms of what it can and can’t tolerate - even within broadcast environments. I get you on the sample frequency thing too - I had a hunch that any issues would be more to do with sample rate than anything else. Thanks as always for explaining it so clearly. :pray:

OK, if anyone is interested, here’s a short video update of where I’m at with this. And although it probably won’t mean much to most people, here’s the technical specs of what’s been done and how I filmed it:

100 ohm resistor wired across speaker positive wire.
3 pole TRS stereo jack in output pod wired as follows:

  • Tip - Speaker+.
  • Ring - Speaker+.
  • Sleeve - Speaker-.

Metallic tape used to connect metal hilt to Speaker- to prevent believed induction hum when handling hilt.

Alternates between sending Speaker+ or Speaker- to jack socket ring connection. (The latter used to ensure correct connection when using a 2-pole [Tip/Sleeve] jack socket like those found on guitar DI cables).

Video shot on iPhone with headset mic to record my voice.

Saber audio recorded live in real time, but clean onto a second camera (Canon D-SLR).
Saber audio recorded by taking one channel of jack splitter cable (unbalanced, tip to left, ring to right, shared ground - so left channel only used) and connecting to XLR balanced Line input on SQN-4S broadcast quality portable location sound mixer. Adapter cable used to fudge unbalanced to balanced conversion by shorting ground to both ground and cold pins of XLR.

SQN-4S output set to mic level and sent via another adapter cable that splits balanced mono to TRS minijack unbalanced left and right. Connected to unbalanced stereo microphone input of Canon D-SLR.
Audio only then used from Canon D-SLR, with that audio then being added to the iPhone video pictures in post producton.

If that sounds like a cheat, it isn’t - the saber audio you hear is the actual audio from the hilt that was being outputted by it during the recording. The only sound the D-SLR was recording was the clean saber audio from the hilt jack pod. This meant I couldn’t really hear the saber audio myself while I was recording - my only cue was the SQN mixer which was on the floor with headphones connected to its monitor output, and I could just barely hear enough to know that button presses had registered correctly, but it was far too quiet to be picked up on my headset mic.

I really hope all of this is making sense. But either way, here’s the vid:


1 Like

I’m surprised that grounding the chassis has an effect on hum. My instinct would be the reverse, isolate the ground, isolate the chassis to get rid of the hum…

I agree. I couldn’t figure out the physics of it because the Proffieboard is in a 3D printed plastic chassis and all the electronics are completely isolated from the metal hilt. The only point of contact I could think of is the red buttons which are resting on the tops of the switches, but I can’t see how they would cause it.

But in the course of testing, I tried holding the hilt while touching the nut on the jack socket and the hum went away. Then I checked continuity between that nut and negative (sleeve) tab of the jack socket and they were indeed bridged, which led me to try a bit of wire between nut and hilt and again that fixed it., hence the end solution. In truth, that solution isn’t the most robust, but it works until I can think of something better.

I’ll play along. Guitar wireless. Receiver > Focusrite Scarlett Solo > USB into computer.
Watch your ears.

Definitely noisy when the mic is open. Ground hum/ air conditioner.