Cheap audio amp design for both headphones & Line - Page 1
Forum section: electronics / projects

author: Saimoun
author_rank: Frequent Contributor
timestamp: September 03, 2020, 11:49:04 am
content: HiI am trying to design an audio amplifier design. My requirements:Low cost is a strong requirement (for manufacturing)High sound quality isnota requirement (the only sound that will be played will be "click" sounds - hence the very harsh filters)There should be volume controlIdeally it should be able to work in two modes: mono headphones mode where the left and right signals are identical, and mono Line mode where the "right" signal has its phase flippedI found that the design used in the TI LM4871 has been copied countless times, so that I can get it for $0.03 f.x., which is crazy since even the cheapest opamps like the NJM8080 still cost at least $0.15.So I came up with the following design:I know this is not (at all) the way the LM4871 should be used - but it just happens to have everything I need, including the flipped phase output!What do you guys think? Is there something in the design that I did not think about that could prevent the whole thing from working? Do you have a better idea maybe on how to meet the requirements with a different IC?Thank you!CheersSimon

author: NiHaoMike
author_rank: Super Contributor
timestamp: September 03, 2020, 01:26:29 pm
content: Have you actually tried the headphones with the out of phase channels?As for the cheapest solution I can think of for driving headphones, since a mere 0dBm into headphones is a very loud signal, you should be able to just connect them to the PWM outputs of a microcontroller through resistors (experiment with the value until you find what gives a good volume range, try 1k for a start) and DC blocking capacitors. Program the microcontroller to output out of phase signals on the two PWMs and the volume control can be a variable resistor connected between the outputs or restricting the PWM range in software.

author: Saimoun
author_rank: Frequent Contributor
timestamp: September 03, 2020, 01:48:45 pm
content: Thank you for the reply.The idea is to set the switch in headphone mode (left=right) when using with headphones. I have tried in the past to listen to music with left and right in opposite phase - your brain does not sum up the signals if that is what you are askingYou can hear the music but it sounds a bit trippy.Unless you meant with this particular circuit? I have not ordered the PCB yet I wanted to ask here firstAnd yes interesting idea about using PWM, I did say I only wanted to play a click sound - but ideally I would like to have the possibility of using very short sound sample like a hand clap, a snare hit or a tambourine for ex, that would not be possible with a PWM would it?

author: NiHaoMike
author_rank: Super Contributor
timestamp: September 03, 2020, 10:41:56 pm
content: Quote from: simonlasnier on September 03, 2020, 01:48:45 pmThe analog audio output on the Raspberry Pi uses PWM and sounds pretty decent for what it is, basically FM radio quality.

author: Saimoun
author_rank: Frequent Contributor
timestamp: September 04, 2020, 08:12:17 am
content: Interesting! But let's say I have a WAV files with samples, how do I convert that to "PWM"? (my idea of PWM was just playing square waves notes like n the arduino tone library)

author: NiHaoMike
author_rank: Super Contributor
timestamp: September 04, 2020, 01:14:42 pm
content: Quote from: simonlasnier on September 04, 2020, 08:12:17 amLook up "class D amplifier". Basically, you run the PWM at ultrasonic frequencies and change the duty cycle according to the audio sample. One very simple implementation is to run the PWM at 48kHz and have the audio samples also at 48kHz. Every PWM cycle, step through the audio sample and set the duty cycle to the sample value scaled by a scaling factor.More elaborate implementations, based in hardware, run at higher frequencies and make use of oversampling to increase the SNR in the audio band. I have a USB-C "DAC" (included with my Le Pro 3 smartphone) based on a SaviAudio chip that can hold its own against a top end headphone DAC/amp based on a more conventional architecture - not bad for something that fits in a USB-C plug! Checking with the scope reveals a residual PWM carrier around 6MHz.

author: Saimoun
author_rank: Frequent Contributor
timestamp: September 05, 2020, 01:58:45 pm
content: Ok I understand - I did think that you would end up running the PWM higher. Basically the concept is the same as DSD (which runs minimum at 64 times the sampling freq).Well I will definitely try it!But in the meantime, is there anything wrong with my solution posted above?

author: bson
author_rank: Unknown
timestamp: September 05, 2020, 06:50:48 pm
content: You don't want RC filters in the audio path; stick to phase-linear filters. They will have constant group delay.In addition, the response of your input filters will depend on the source impedance and output on the load impedance, neither of which is a quantity you will know in advance in consumer audio.

author: Saimoun
author_rank: Frequent Contributor
timestamp: September 08, 2020, 04:55:58 pm
content: >>You don't want RC filters in the audio path; stick to phase-linear filters. They will have constant group delay.Interesting - can you explain what a phase linear filter and group delay are? thank youRegarding the input filter, I would like to fully understand how to calculate it actually - my DAC is from an STM8 MCU (stm8l151g6u6) which as a built-in buffer so its output impedance is very small. Therefore I calculated the filter with R1 + POT1*position as impedance, are my calculations correct?And regarding the output filter I think it is ok, most headphones will not go below 32 Ohm, and if they do the filter will simply remove more of the low-end which like I said does not matter much in my application. Any value above 32 Ohm will simply keep more low-end.

author: bson
author_rank: Unknown
timestamp: September 10, 2020, 10:03:14 pm
content: Linear phase is where the phase response plots a straight line. Because phase is an angle relative to the frequency, a fixed delay across the entire band results in a straight line increasing angle. In other words, as an example a 10µs delay at 1kHz is represented by a different angle than 10µs at 10kHz. Group delay is the slope of this phase response line and is a time unit. In the example it would be a constant 0µs. (For a non-straight phase plot, what we call a non-linear phase response, at any one point it's the differential of the phase wrt to frequency.) RC filters don't have a linear phase response, so different frequencies have different time delays. This in turn means the waveform out is not the waveform in even if entirely within the passband.

author: richard.cs
author_rank: Super Contributor
timestamp: September 10, 2020, 10:58:17 pm
content: So you have a single input signal that you apply to both outputs, either in or out of phase. I think if I were designing for bare minimum cost I would use only one amplifier and connect both sides to it. The LM4781 seems to be obsolete? So don't plan on long-term availability at that price.I would expect you to be able to get a bargain-basement opamp for less than that in volume, and you could certainly go cheaper than that with a discrete design. You said you weren't interested in audio quality, and headphones need minimal drive power, so we could be talking a single bipolar and ~5 passives. I didn't have to look for very long to find Chinese *3904 for $12 per reel of 3000 which is $0.004 each. Of course as NiHaoMike points out, do you even need an amplifier at all?Actually the most expensive thing in your design is almost certainly the connector or the switch. You can't do anything about the connector but if you could replace the switch with a microcontroller port pin or similar and make that feature software controlled. Likewise do you need a pot or can that be done via the micro as well? Your capacitors could probably shrink as well, pretty much all of them.

author: richard.cs
author_rank: Super Contributor
timestamp: September 10, 2020, 11:36:19 pm
content: The attachment shows the very cheapest thing I could come up with. It is not optimal for audio quality, power consumption, or pretty much anything else, but it is cheap.The left hand circuit drives the headphones in antiphase, from sufficiently low impedance to be "loud enough". Probably. You could add a switch to move both to one output for in-phase. The right hand circuit instead generates the antiphase by putting the headphones in series and then switching them in parallel to put them in-phase. The expectation being that a mosfet controlled by your micro (which could even be a port pin switched between tristate and pulldown) will be cheaper than a switch. Naturally this one is rather quieter, R6 and R9 keep the levels roughly constant in the two states but it'll be horribly dependent on headphone impedance. With two switches it'd be much improved but a 3 transistor design will probably cost over a cent and thus breaks the budget I set myself. You could also add mosfet(s) to the first circuit.Both circuits are terrible, don't use them, but it was a bit of fun to work out what was possible on a <$0.01 budget

author: Saimoun
author_rank: Frequent Contributor
timestamp: September 11, 2020, 01:52:07 pm
content: @bson -> thanks for the explanation, I did not know thatI'll keep in mind for the future but really for this design phase errors are not a problem.@richard -> very interesting thinking about the switch and the pot! The pot especially costs half a dolar, it is true I could remove it and make the volume control from the MCU. Problem is the audio is already 8-bit, and each -6dB is one bit less. So already at -42dB I am sending 1-bit audioFor the switch yes you are right I could simple control it from the MCU - how does that work though? Can I do that with a mosfet?And thanks for the ideas - I did not quite understand how it works though, where do you connect your jack?And just FYI the audio output has to be used by really-deaf musiciens who have been playing live for years - and you would be suprised how loud they want things to be

author: richard.cs
author_rank: Super Contributor
timestamp: September 11, 2020, 03:18:21 pm
content: Quote from: simonlasnier on September 11, 2020, 01:52:07 pmDoes the dac have a reference input? You could use that to scale the output if it does. Otherwise a mosfet or a diode could be used as an attenuator for much less than the cost of the pot.Quote from: simonlasnier on September 11, 2020, 01:52:07 pmYou can, but you'll probably need two mosfets to get the changeover functionality and then several more substantial coupling capacitors. It may be more cost effective overall to go back to having two amplifiers if it allows you to do the switching at high impedance.Quote from: simonlasnier on September 11, 2020, 01:52:07 pmSorry if it wasn't clear, The two 32Ohm resistors were crudely representing the headphones.

author: Saimoun
author_rank: Frequent Contributor
timestamp: September 11, 2020, 04:28:20 pm
content: QuoteHa ha I did not realize!! This is hilariousQuoteI'll be really interested in hearing about how you do that!The DAC does not have a reference input, but even if it did, I woud still need a pot to set it to different voltages (volume levels), wouldn't I?QuoteBut even if I keep the two amplifiers, i.e. I have a line with Signal A on the board, and Signal B which is the inverse of A. How do I "simulate" the switch from a microcontroller?

author: richard.cs
author_rank: Super Contributor
timestamp: September 11, 2020, 06:12:16 pm
content: Well, here's a similarly-crude example that phase-flips based on one port pin and attenuates based on another (finer volume control you would do with the DAC). Note that I have already wasted ~1 bit by offsetting the DAC to avoid a few bias components. Note also the huge amount of waveform distortion, and that right channel ends up rather louder than left. These areverypoorly performing designs from an audio perspective.As a more practical suggestion, rather than taking the approach I have done here that seeks to minimise cost at the expense of all else, look at what you can do with a low cost opamp and perhaps something like a CMOS analogue switch IC that lets you get the phase functionality you want and a couple of big loudness steps controlled by port pins. You might then have a $0.30 circuit but you've got rid of both pot and switch and still made a substantial saving on overall cost.

author: Saimoun
author_rank: Frequent Contributor
timestamp: September 12, 2020, 08:25:21 am
content: My experience with BJTs and mosfets is quite limited so I do not quite understand how your circuit works. It is still very nice to hear your suggestions, and in a few months and I will go back to itBut like you said from a practical point of view it would not work - if the level difference between the left and right channels is audible that would be a problem - and same with distortion. Basically the users are not going to fiddle with the sound trying to see/hear the "quality" but on the other side I should be good enough so they can use the device without going "urgh this sounds awful".I mentioned that I do not care *that* much about audio quality because I asked before and got a lot of suggestions of really nice fancy opamps that cost $2 piece that clearly I was not going to useBut removing the pot and the switch will definitely be cost saving! If it is possible without having a huge impact on the sound qualityMy problem here is a bit more general I guess: I do not know how to make a "switch" controlled by a GPIO or how to control the volume other than digitally. I guess I should look "CMOD analog switch IC" up?

author: richard.cs
author_rank: Super Contributor
timestamp: September 12, 2020, 10:07:53 am
content: Quote from: simonlasnier on September 12, 2020, 08:25:21 amAs an example of such an IC, the CD4066 is around $0.10 in volume and contains four analogue switches controlled by logic inputs. You could for example use two of these switches as a changover switch to control the phase of your signal, and then you could use the remaining two switches as part of an attenuator for volume control, basically some switched resistors. You might for example set your attenuator up such that it can divide the audio signal by 4, 16 or 64 (one switch divides by four, one divides by 16 and you have the option to use both together). That gives you some coarse ranges, and then for finer volume steps in between you use the DAC, always retaining at least 6 bits resolution because each time you get down to 6 bits you switch in the next attenuator and go back up to 8.Datasheet:https://www.ti.com/lit/ds/symlink/cd4066b.pdf?ts=1599904045026&ref_url=https%253A%252F%252Fwww.google.com%252FA reasonable setup might consist of one such switch on the output of the DAC setting volume and phase, and then two opamps in a single dual package driving your two channels (the switch on resistance is high so you have to do the switching before the amplifier). You might add a couple of BJTs to buffer the opamp outputs for low-impedance driving, but you can put them inside the feedback loop of the opamp so the distortion is then low. Overall cost might be $0.10 for the switch, maybe $0.15 for the dual opamp, $0.02 for the transistors. With the passive components it might bring you to around $0.35, but no $0.50 pot or mechanical switch ($0.25 for a cheap one?).Sound-wise this $0.35 circuit will be way, way, better than the $0.01 junk I sketched further up, but will be a long way off perfect. Still with an 8 bit DAC it's only going to be telephone quality anyhow.As a general point for cost reduction on high-volume products, once you have a microcontroller in the design try to pull as much functionality into it as possible and have the least amount of external pots, etc. It makes the software more complex, but it software contributes zero to your per-unit cost.

author: Saimoun
author_rank: Frequent Contributor
timestamp: September 12, 2020, 04:13:55 pm
content: Thank you Richard that helps a lot! It's funny I have been doing electronics for a couple of months and still had not been through multiplexers!! I came across the 74HC chip a few times but actually never investigated what it was! Anyways - you just opened a whole new door for me!!So, following what you said, I decided to stick to the LM4871 design because as I only have a 3.3V rail I need a rail-to-rail opamp. Also that way I know it is strong enough to drive headphones. Also the design is not going obsolete - like I said there are many chinese copy, all with the same design and even same pinout (just check f.x. onhttps://lcsc.com/products/Audio-Power-OpAmps_518.htmland sort by price, all the first ones have this design).Then the SPDT switch is actually only $0.01 so I kept that.And finally I removed the expensive pot replacing it by a CMOS switch. It turns out my DAC actually can manage 12-bit so going from 12 to 7 bit, that is -30dB difference, then adding a -36dB gain change with the CMOS switch means I can go all the way down to -66dB, that should be plentyI end up with the attached schematics.Price is:* opamp: $0.02* SPDT switch: $0.01* SPDT CMOS switch: $0.04* coupling caps: $0.03* all of the small caps and resistors are already used in the rest of the circuit, so they are almost freeThe CMOS switch I found is the following:https://datasheet.lcsc.com/szlcsc/1912111437_Gainsil-GS4157-CR_C280709.pdfMy questions about the CMOS switch since I never used one before (if it is not too much to ask):* Am I right to add the 3Ohm resistance of the switch to the feedback resistor?* I can see it is rail-to-rail, bandwidth way over the audio, and works at 3.3V - any other parameters I should consider?

author: richard.cs
author_rank: Super Contributor
timestamp: September 13, 2020, 09:30:47 am
content: This design looks good. In terms of resistance yes it is correct to add it in but at 3 ohms it is negligible anyway. In situations when it is not negligible you have to be a little careful because the switch resistance is usually very variable between devices and over temperature.You could get away with a switch IC that is only on/off rather than changeover. This is because you can have the higher valued resistor permenantly in place and switch another resistor in parallel, chosen such that the two in parallel give your lower value. That may give you a wider selection of switch ICs to choose from.

author: Saimoun
author_rank: Frequent Contributor
timestamp: September 14, 2020, 03:26:37 pm
content: Thank you Richard! And great point about the switch IC, I am sure there are a lot more choice of SPST than SPDTI'll look into it and actually make the device! I will write here what I get from it

author: Saimoun
author_rank: Frequent Contributor
timestamp: October 02, 2020, 01:07:41 pm
content: Hi again!A few weeks have passed, I have now ordered these 2 cents chips (FM8002A) and build a test circuit - the circuit I posted above.It turns out: the chips is great!! It works beautifully, and sounds pretty good - more than good enough to play click sounds - for 2 cents!! I actually tested it playing real audio (music) from an external audio source (playing at 24bit).I found out a few things:The whole thing runs at 3.3V, and sending about 3Vp-p into headphones, even cheap ones, is quite loud!Richard you were right the caps do not need to be that big, I tried to replace the two 47uF caps (C3 & C4) with my MLCC 4.7uF decoupling caps - it does cut a decent amount of lows but actually still sounds decent - even with music. I know it might generate sounds because of microphonics but I am ok with that. I also replaced C1 with a 100nF.the U2 IC (analog switch) is an SPDT - that is a major issue because when switching it has this "break-before-make" which puts the gain at maximum for a few milliseconds, that creates a massive pop in the headphones. Using a SPST analog switch will solve the issue, but it also turns out that -36dB is already a lot, I think I can drop the analog switch all together and simply control the volume from the DAC.I tested playing music at 8-bit/32kHz directly from the DAC of my MCU and it sounds pretty bad (nothing to do with the amplification though) - I think having only 8bits adds a lot of high frequency content (the "edges") so there is a lot of "sssshhh" and "pfff" noise there, and the high frequency sounds from the music (like s'es on the vocals or the hihat f.x.) sound extra-harsh. Hence the 4th point.I have been playing with C2 which puzzled me*a lot*. I have a jumper on my test board so I can easily connect or disconnect C2 while hearing the music. I first tried with C2=2.2nF - should cut around 15kHz - I could not hear a difference. Then I tried with C2=12nF - should cut around 3kHz - same thing, really could not hear a difference - that is crazy because a 3kHz cut should definitely be hearable! Then I tried with C2=1uF - this cuts at 33Hz!! This one I could hear, and yes it does make the music a bit more dull (cut the highs), but it feels more like it just make the whole thing less loud.My questions are mainly about the last point1) Are my calculations correct - an inverting opamp should have an input impedance of the series resistor, in my case R1=4.7k, correct?2) Is this behavior because of the slope of the cut, meaning it cuts so slow that it is barely hearable?Thank you!!SimonPS: just adding the picture from the precious post as a reference:

author: richard.cs
author_rank: Super Contributor
timestamp: October 02, 2020, 01:37:42 pm
content: Quote from: simonlasnier on October 02, 2020, 01:07:41 pmIf you don't need it then sure, but you can of course use your existing switch as a SPST and simply connect the right hand side of R2 to pin 4 rather than 3 (and if you care about exact gain ratios increase R5/6/35 slightly).Quote1) Yes, because the opamp keeps the inverting input at constant voltage. Impedance will change if your signal starts to clip the output, or if it goes outside the opamp supplies.2) Partly yes, a first-order slope isn't that strong, but also may suggest you have little high frequency content to start with.

author: Saimoun
author_rank: Frequent Contributor
timestamp: October 02, 2020, 09:36:45 pm
content: Quote from: richard.cs on October 02, 2020, 01:37:42 pmHa that is true I did not think about thatI actually found a nice SPST analog switch from NXP but ironically it is a tiny bit more expensive than the SPDT one I found.And regarding the high cut I actually do have a lot of high frequency content - as I said I guess this is from the low amounts of bits? - which I was hoping to cut. But clearly first-order will not do that.

author: Saimoun
author_rank: Frequent Contributor
timestamp: October 02, 2020, 10:05:09 pm
content: I have an FFT on my oscilloscope - not the best but it gives an idea - and looking at the effect of C2, I am really wondering if I should drop it completely?Clearly it has no effect on the hearing range:with C2=10nF nothing changes, and with C2=1uF then the whole thing goes down by about 15dB, just like I could hear.The only actual usage for C2 would be for EMI reasons, then?When I start looking in the MHz range, then yes it does drop like you would expect - still very slow slope though. See attached the FFT from 0 to 2.5MHz with and without C2=10nF. I am playing a 1kHz sine wave from the DAC, and the peaks you are seeing are at 32kHz and resonating as this is the DAC sample frequency.Funny thing is the peaks below 300kHz are actually slightly higher (just a few dB) with C2 on.

author: richard.cs
author_rank: Super Contributor
timestamp: October 03, 2020, 12:54:05 pm
content: Looking at your schematic again the problem with C2 is that it only forms a filter at all due to the output resistance of the DAC, which is rather indeterminate and may vary with temperature, most likely the DAC output resistance is on the order of 50-100 Ohms. R1 is simply not in the right location, sorry I should have spotted that earlier. I would probably make the following changes:1. Put a resistor in series with C1, ideally one that is large compared with the DAC output resistance and small compared with R1, let's say you use 470 Ohms. You can then change C2 to 4.7 nF to give a 3 kHz corner when working against that new resistor, and the effect on the rest of the circuit will be minimal other than that you might need to increase C1 a bit.2. Put capacitors in parallel with both R2 and (R5||R6||R35), both chosen for a 3 kHz corner against the resistor it is in parallel against. That will then give you a second order rolloff with the same characteristic in both gain settings.What sample rate are you driving the DAC with?

author: Saimoun
author_rank: Frequent Contributor
timestamp: October 03, 2020, 01:30:19 pm
content: Thanks for the reply!Regarding 2) - you opened my eyes again, of course I can simply use the opamp in the IC to make a second order!I am bit confused about the rest: the DAC is buffered (inside the MCU), so its output impedance should be close to zero?And about 1) you mean to have the following?Code:DAC -> 470 res -> C1 -> . -> 4.7k res -> negative input|C2|GND

author: richard.cs
author_rank: Super Contributor
timestamp: October 03, 2020, 04:11:09 pm
content: Yes, like that.I've not looked at the dac datasheet but if it's buffered it's output impedance will be low, at least at audio frequencies, though will rise above the bandwidth of the buffer. The point is it's likely much lower than 4k7 so that means C2 provides a higher corner frequency than you expected. If it were zero impedance then C2 would give no filtering at all.

author: Saimoun
author_rank: Frequent Contributor
timestamp: October 04, 2020, 03:06:36 pm
content: Ok that would explain the measurements!I am not sure I still understand why though, do you mean C2 should be after the 4.7k resistor? and if I keep C2 where it is and add the 470 ohms resistor, then what is the filter cut frequency, is it 1/(2*pi*C2*470)? Because that would still be very high (>100kHz).Anyways - feel free to answer the questions or ignore them - I'd still be happy to know but I have moved on a bit: you made me realize I can use the I have been reading about filters over the last couple of days and came up with the attached design. It is a second-order Butterworth filter using a multiple-feedback (MFB) topology. I used (among others) this website to get the values:http://sim.okawa-denshi.jp/en/OPtazyuLowkeisan.htmIt cuts at 18.4kHz with a Q=0.51.That type of filter was also recommended by an audio DAC's datasheet which I have been reading (clearly not the DAC I am using here) -https://www.ti.com/lit/ds/symlink/pcm1681.pdf(see page 32).I'll solder it on my test board, do some measurements and post them here - again thank you so much for the help!

author: richard.cs
author_rank: Super Contributor
timestamp: October 04, 2020, 03:42:42 pm
content: Quote from: simonlasnier on October 04, 2020, 03:06:36 pmYes, you'd need to increase the value of C2 from the 12 nF you had for 3 kHz against 4k7 to 120 nF. Admittedly I did say 4n7 as being 10x the 0.47nF you had in the schematic, but that was incorrect (I was scaling from the wrong starting point) and as you point out gives a much higher corner than you want.QuoteI've not checked your values but that type of filter generally works well so long as you don't try for too high a Q. Naturally the increased complexity of the feedback network makes gain switching harder but as you've concluded that's not required then it's a good choice. If you did want to bring back gain switching you might be able to get away with a simple switched attenuator before the amplifier, not optimal from a noise perspective but probably good enough.

author: Saimoun
author_rank: Frequent Contributor
timestamp: October 08, 2020, 03:12:02 pm
content: Alright I understand the logic nowI made a few tests with the filter and it looks great. I compare the input of the circuit (DAC output) and the headphones output and I get similar curve than the one shown on the website where I made the calculatios (http://sim.okawa-denshi.jp/en/OPtazyuLowkeisan.htm), though it seems to cut a bit more than expected - not exactly sure why. I get f.x. about -7dB at 10kHz when I compare, while the theory says it should be about -3.5dB. My oscilloscope is not the greatest so also maybe the values are not that accurate. Anyways - for this design it does not matter much anyways, the filter does its job!All in all I'm really happy with the results - with a 2 cents amplifier chip!I also tested with 12-bit audio - and yes that confirms where all the hiss and pff noises came from: 8-bit audio sounds pretty bad. At 12-bit I can even play a song and it sounds very clean, I would not be able to tell the quality difference (apart from the massive high-pass filter because of my output cap) from the same song played on professional audio gear (and I produce music regularly so my ears are trained). The problem with starting at 12-bit is as soon as the volume goes down then the sound gets degraded very quickly.I actually did more test on this with my computer, I got Audacity to play the same song saved in an 8-bit WAV file, and yes you could hear the same type of hiss/pfff noises, but a lot less. My guess is Audacity might do some smart algorithm (I am not sure if it is possible to add dither f.x. after it has been saved in lower bitage) to reduce the noise maybe?Anyways that is starting to get out of topic! And in this case all this thing has to play are snare or cow bell hits - not the end of the world if the sound is degraded a bit.But thank you so much for the help Richard - I have done more than enough testing, I'll lay out a PCB with the whole project now and order a few prototypes to see how it goes