this post was submitted on 08 Mar 2024
150 points (95.7% liked)

Asklemmy

43968 readers
892 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy 🔍

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~

founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] bloodfart@lemmy.ml 1 points 8 months ago (1 children)

no worries. i've been enjoying going back through this. you're basically me 25 years ago emailing the winamp ppl to find out what volume control i should use to turn down (for what!).

so there's a misconception here between compressing a signal and attenuating it. imagine you are looking at a frequency spectrum chart of some song instead of listening to it. it's got some loud sounds, which show up as big peaks on the chart, and some quiet sounds which show up as small peaks on the chart and there's a noise floor which is the stuff in the chart that's not a peak at all.

if you plug a potentiometer in between your signal and the spectrum analyzer and turn down the volume, youll see all the peaks, loud and small, be reduced in amplitude by the same amount. this is called attenuation. the quieter sounds could be reduced until they are part of the noise floor and become imperceptible while the louder sounds would still show up.

it doesnt matter if you achieve attenuation by dividing the 16 bit level component of a stream of samples or by using a resistor as a voltage divider. the quiet and loud sounds are affected equally. those two ways of achieving attenuation function the same because they are performing the same operation.

now lets say you plug a rack mount compressor effects module in between your signal and your spectrum analyzer instead. you could apply more compression to the signal and achieve exactly what you describe, a smaller distance between the quiet and loud sounds, reduction of the original scale, removal of dynamic range, effective bit depth reduction! it would be actual factual "we just crushed the signal into 1/25th of its original scale".

and if you used a module (or software package) with the capacity for it, you could tie the compression ratio to a gain control so that the compressors output got quieter when you turn the compression ratio up, resulting in more heavily compressed sounds at a quieter volume. that's a neat little mastering trick to make recordings sound "lively" and "intimate". makes all those pick scrapes and finger swishes stand out alongside the plucked strings.

you could also do the inverse, make all the quiet sounds louder, so that the guitar is as loud as the kick drums' transient and it would make your whole song sound much louder and stand out better against background noise in a difficult listening environment like a car radio or cell phone inside a solo cup.

there are even modules that do the opposite, called... expanders! they do what you might expect, increase the dynamic range between loud and quiet sounds. a company called DBX made models for use in home stereos in between tape decks and the amplifier in order to reduce the noise floor of tapes.

but it's none of that is attenuation, the operation that your volume control provides.

and you're correct, both compression and attenuation are lossy operations no matter if they're done with analog electronics or by a microprocessor operating on a buffer somewhere in memory. the difference is that attenuation is literally required to prevent permanent hearing loss and possible equipment damage, while compression is not.

[–] teawrecks@sopuli.xyz 1 points 8 months ago (1 children)

it doesnt matter if you achieve attenuation by dividing the 16 bit level component of a stream of samples or by using a resistor as a voltage divider.

This is the part where I'm not following. In my head, if you're using analog hardware of sufficient quality, you can attenuate the signal to be very quiet, but still preserve it's dynamic range. In fact, the DAC is already outputting a very weak, but faithful analog reproduction of the signal, and an amp with a decent S/N ratio is able to bring that very weak signal up to a listening volume without introducing enough noise to matter.

Hypothetically, if for some reason, you took the signal post-amp, used a pot to attenuate it again down to the energy of the post-DAC level, and again ran it through another amp you would theoretically have the same signal still (I understand that in the real world we would start amplifying noise and the signal would degrade, but stick with me). Nothing about the process necessarily introduces noise and thus destroys the signal, you're only limited to the quality of the components at that point. If you had an infinite chain of theoretically perfect amps and pots, you could repeatedly attenuate and amplify the signal forever without ever losing any quality. It's an analog process that theoretically preserves the signal, +/- some amount of error due to physics.

Meanwhile, 16b is 16b. If you start shrinking all samples relative to each other (ex. down to 1/64 the original volume, or 10b of resolution), different values inevitably have to clamp to the same values (fitting 64k values into 1024 values), losing information and resulting in poorer quality. If you then try to send that 10b signal through a DAC/amp to achieve the same listening volume that you would have had before digital attenuation, it's just a 10b signal bit shifted up. All your LSBs are 0s. You can't possibly attenuate digitally, and then amplify it in any way and hope to get the same signal back. It's a discrete math process which destroys the signal by design.

Would you agree?

[–] bloodfart@lemmy.ml 1 points 8 months ago (1 children)

the effect of attenuation is the loss of intensity of signal.

loss. it goes away.

attenuation is a lossy process. information in the signal is literally absorbed and radiated away as heat. it cannot be reconstructed because it's gone.

it isn't an analog process that theoretically preserves the signal, it's an analog process that explicitly destroys a component of the signal.

but what if it wasn't...

okay, lets assume for a second that you have a signal with the same harmonic content as one of my previous examples, a high peak when viewed on a frequency spectrum chart, a low peak when viewed on that chart and everything else. these three parts of the signal represent the loud, quiet and "silent" parts of the signal respectively. unlike the previous example we'll let our noise floor for the silent parts be infinitely low. for now. so you start hooking up your perfect amps and pots in line and setting them all to 1% or so and listening. it's sounding pretty good at first, but once you get a few deep, you start getting white noise and clicks and pops and all kinds of craziness.

what the hell! all this equipment is theoretically perfect, why is there noise? it can't be coming from the perfect equipment!

it's not. it's coming from the medium. in our theoretical example all these amplifiers and pots are hooked up with conductive wire. the signal has to propagate through that wire from component to component. atoms of copper are being excited and losing their excitation in proportion to the signal. their state of excitation is being amplified over and over again. the noise is in the wire. by amplifying it over and over again you made it audible. you can't ever escape it. signed, listening to noise gang. come to my modular synth show.

okay, so now that the possibility of ever attenuating a signal without losing information is hopefully put to rest, lets turn to the digital attenuation of the signal in comparison.

level attenuation over the digital domain is also a lossy process. what's being misunderstood here is that the levels aren't being shrunk relative to each other, they're each being divided and the signal that's reconstructed by the DAC no longer contains the quiet parts.

just like those quiet parts were absorbed and radiated as heat by the resistor, the digital version of attenuation does away with the need for all that physics crap and simply deletes them from the stream.

if the levels were being shrunk relative to each other, you'd be compressing the signal like when you use the bitcrusher pedal for your guitar and there would be lots of harmonic distortion. but attenuation and compression are different processes and have significantly different results.

consider a quiet sound, your 1/64th volume signal. a sine wave. its encoded to represent 1/64th of the maximum level of the adc's input because when it was recorded, it represented 1/64th the maximum level of the preamp/microphone/whatever that was plugged into the adc.

is the quiet sine wave of lower quality than one that's using the full bit depth of the adcs output because it's intended to represent the maximum level that the adcs input saw from the preamp/microphone/whatever?

of course it isn't. it just wasn't loud.

and if your loud sine wave was electrically generated by a theoretical perfect function generator which contains no distortion or other sonic content before being sent to the adc, would it be more damaged if it's amplitude were divided by 64 before being decoded or if it were decoded and sent through a resistor whose value was chosen specifically to dissipate 63/64ths of it as heat in order to make it as quiet as the quiet sine wave?

of course it wouldn't.

to your last question, let me rephrase it into something I can agree with: you cannot possibly attenuate and then amplify in any way and hope to get the same signal back. It’s a lossy process which destroys the signal by design.

[–] teawrecks@sopuli.xyz 1 points 8 months ago (1 children)

Ok, the analog attenuation part makes sense now I think. I assumed that an amp increases the amplitude of a signal, and that a pot achieved the inverse (i guess dividing the signal?) but it's not, it's effectively subtraction?

Back to my DAC/amp, realistically am I ever intentionally attenuating the analog signal in order to get it to a listening volume? Or am I only ever amplifying it? I think that's the main difference in my head. If I output my digital signal to the DAC at 100%, and then only ever amplify it to a listening volume, then there's no way for the signal to be attenuated at all, right?

is the quiet sine wave of lower quality than one that's using the full bit depth of the adcs output because it's intended to represent the maximum level that the adcs input saw from the preamp/microphone/whatever?

of course it isn't. it just wasn't loud.

No, yeah, that makes sense. I was thinking that, it didn't matter how strong the signal was, as long as the full sine wave was still present, then quality is preserved. So dividing it down to be a very small voltage, or amplifying it up to be super large, as long as the relative voltages of the signal are retained, we wouldn't lose any quality (is my, likely flawed, impression).

I think I just don't know how to think of analog signals. I understand frequency response in theory, but I can't talk about a signal intuitively in terms of frequency space like you do. Does perfectly amplifying a signal change its frequency response? You don't have to keep answering, at this point I'm just poking your brain lol.

[–] bloodfart@lemmy.ml 1 points 8 months ago (1 children)

if you use the volume control on your amp, you're attenuating the signal. that's assuming that the amplifier uses a pot as a voltage divider on the input rather than a gain control for the amplifier IC it uses. both are common, but if it's used as a gain control you're relying on the linearity of the pot to inform the gain of the amplifier IC and generally frequency linearity across wide gain ranges aren't fantastic which is why old stuff that used a bunch of discrete transistors instead of chips had set gain and varied the input signal level with an attenuating pot acting as a voltage divider. there are counterexamples. this is complicated.

if you don't use the volume control on the amp then there's no attenuation. the downside is that it's really loud. too loud for safety. too loud for comfort. sometimes too loud for the sustained operation of the equipment.

perfectly amplifying a signal does change its frequency response by adding noise picked up in the process of conveying that signal to and from the perfect amplifier. the noise is added because it's amplified. there's some ways to lessen the effect of this, some are effective enough to allow absolutely miniscule signals like those produced by a moving coil phono cartridge to be amplified to tremendous volumes. but there is always noise.

all this talk about amplifiers and volume control is wonderful, but have you considered the stuff that comes after the amplifier? your headphones are a great example: if you pan over to the right channel so that only the right headphone is making sound and slowly pull the headphone away from your ear you'll hear the frequency response change. the lowest notes will go away, then higher and higher pitched notes will become inaudible until all you hear are tinny high frequency sounds. that's the effect of attenuation of the sound wave propagating through the air. naturally in air, that attenuation acts as a high pass filter, reducing the volume of the lower pitched notes more than higher pitched notes.

if you pull it away in time with the beat of the music it acts like a bpm synced filter effect or a wah pedal (depending on your age).

the distance from the driver to your ear has an effect on the sound you hear. is that distance correct? everyones heads are a little different...

how about the ears themselves, are they clean? it's gross to think of, but wax acts just like a pair of earplugs.

and what about your own brain. i'm not even close to versed in psychoacoustics but just imagine agent smith from the matrix saying "you think that's music you're listening to?"

there's nothing wrong with wanting good quality equipment and for it to perform as close to perfect as possible but at some point we're picking only the most perfectly ripe, unblemished, peak season tomatoes to make salsa.

[–] teawrecks@sopuli.xyz 1 points 8 months ago (1 children)

if you don't use the volume control on the amp then there's no attenuation. the downside is that it's really loud.

Ahhh, I think this is the part I was missing. So I should think of an amp as "injecting" a fixed amount of energy to the signal, way more than I need, and then the volume pot attenuates it back to a comfortable volume. That makes sense since we've established that pots attenuate, which necessarily destroy the signal. I still had it in my head that the amount of energy used to amplify the signal was proportional to the volume knob position.

I didn't know how air affected frequency response, but that makes sense.

As for how clean my ears are, I'm completely deaf, so who cares?

jk 😁. Thanks for the talk, I learned some things!

[–] bloodfart@lemmy.ml 1 points 8 months ago (1 children)

No problem. It’s nice to talk about this stuff. If you want the skinny on amplifiers:

There’s two parts: the volume control and the amplifier. The volume control sits in between the input and the amplifier circuit itself. The amplifier circuit can be thought of as a fixed multiplier of whatever signal goes in. If there’s x50 gain then it’ll make an input of 20 into 1000 arbitrary units(tm). An input of 2 would be made into an output if 100au and you choose between those two inputs or any number you like with the volume control, acting as an attenuator before the amplifier starts multiplying the signal.

To look a little closer, the amplifier takes a big dc voltage and modulates it based on the small input voltage. If it was a tube amplifier, all the dc voltage gets put on the plate of the tube, the input is sent to the grid (a literal grid of wire in between the plate and cathode) and electrons jump through the grid to the cathode in proportion to the grid current. If the grid current is a song, then the massive amounts of electrons gathered at the high voltage plate will jump across to the cathode in proportion to it and if an enterprising person were to put a transformer and speaker in between the cathode and their path to ground those electrons could be used to move it back and forth!

Of course, they only do that in a vacuum and when heated up, so all that takes place inside an evacuated glass tube with those parts crammed into it next to a light bulb filament to make them toasty.

Point is: you’re not even getting the same electrons!

Your solid state amplifiers are doing the same thing but with transistors instead of vacuum tubes. Feed the input into the base of the right kind of transistor and it’ll let more or less voltage move in the direction of its arrow.

You get a few of the input electrons with a transistor, but it’s mostly electrons from the big dc voltage.

[–] teawrecks@sopuli.xyz 1 points 8 months ago

Ahh ok, that makes more sense. I think I never saw the connection between a transistor and an amp until now. Using a small signal to modulate a different, larger signal. Or like a relay.