Skip to main content
Recent Posts
2
Scientific Discussion / Re: Audio Summing Algorithm
Last post by Nikaki -
However, what if signals are out-of-phase?
In the worst-case scenario (two inverted signals, as in attached picture) waveforms cancel each other and after down-mixing you'll hear literally NOTHING!
This is true even if you don't mix but instead use two different sound sources. So actually not trying to avoid this gives you very high, real-life physics accuracy ;-)
3
Scientific Discussion / Re: Audio Summing Algorithm
Last post by jsdyson -
@antony96 when adding samples: when you're adding two discrete time samples, you just add them like that.

Samples will either constructively or destructively interfere, that is perfectly normal and it happens in the real world all the time. You must then scale your envelope in case you want keep things from clipping, in case you want to ensure a non-clipped signal. Also keep in mind the type of signal we're talking here. Technically, you want your values to be in a manageable domain, like signed float, so they can be added beyond an imposed top-level. I.e. effectively using arbitrary precision, etc. When it comes to signal processing, it's much better (imo) to think of it purely as a mathematical construct. Whatever you want to then quantize to put it as PCM values into a file, is to be decided /after/ you're done with your signal processing as such. This is especially important when you're designing signal path circuits with active filters and suchlike.

In case you need a better mental image, make sure you're working on a signed, float basis, this actually represents a "natural" signal, unrelated to technical "technicalities" the closest.

In case you need a better representation of such signals, think of brightness levels in pictures, each line in an image is essentially a one-dimensional signal (assuming it's grayscale), etc.

If you wanna try things out, Octave comes with a bunch of pre-made function for discrete-time signal summation, and loads of other functions. So do some playing around with that, and you'll learn a lot by simply trial and error.

A nice beginner's cheat-sheet: https://en.wikibooks.org/wiki/Digital_Signal_Processing/Discrete_Operations

Not sure if it makes sense getting more technical, but if you are interested in LTI systems, and signal processing in general, it's a good idea to start with simply the nomenclature, learn what convolution is, and what it represents, etc.
Whether you want to go into Laplace and Fourier transform, I'd suggest getting to grips with the basics, first.

You might also wanna browse a bit around on: https://dsp.stackexchange.com/
Especially when it comes to the more mathematical aspects of signal processing, it's a good place to get help, etc.

You might also wanna check out university coursework material, like this one: http://web.eecs.umich.edu/~fessler/course/451/l/pdf/c1.pdf

Yes -- the very best is to be educated/understand the matters in depth.  I was purposefully being a little too detailed but not detailed enough also.  When I saw the question and answer about summing the signal, that started conjuring up all of the various 'summation' issues that I have run into...   Probably the most important are the matters of clipping and/or truncation when dealing with fixed point operations.  (I normally work in floating point which gets rid of 90% of the problems -- but not 100%.  It is still good to know the various potential problems.)
Also, I brought in the spectre of phase because of the additional dynamic range/gain issues that happen when doing the potentially problematical 'divide by N' but also noting that 'divide by sqrt(N)' isn't really an adequate solution either.
I was trying to short circuit the idea (esp if the questioner would ever write much DSP code in the future) that the one and only answer to summing the signals is to 'divide by N'.

For a perfect example of the fact that 'divide by N' isn't always the best answer -- think of yourself sitting at an audio control board -- are all of the gains turned down every time that a new source is added to the mix?  answer: NO.  What is the reason?  When adding the signals, one isn't adding the peak levels of each signal, but rather the signals themselves which have statistical and/or phase characteristics.  Simple amplitude values do NOT have phase, but are just a number.  So in the real world, it isn't always correct to just 'divide by N'.   Divide by N is mostly a worst case suggestion given that the truncation and clipping issues are also correctly handled.

John
5
Scientific Discussion / Re: Audio Summing Algorithm
Last post by jsdyson -
ziemek.z:
care to post a few samples with the sources and results of this mixing approach? (I presume you have some software implementation at hand)
also including what happens when you mix a signal with silence and then adjust the gain to match the volume — does that produce a result that's (audibly) different from the source?
if you arbitrarily change phase across time, it could be possible that this distortion could be noticed… hard to tell without samples though.

> However, if you're doing musical stuff, that effect is unwanted
this effect is completely fine and it won't matter in practice if you are mixing uncorrelated signals, such as different instruments. it just means if you are duplicating tracks in your DAW for some reason, or recording a single instrument with several mics at the same time, then you need to think a bit more to do stuff correctly.
and it is what will happen in the air/ears anyway if you are listening to several natural sound sources, too.
This software seems to be in the area that you are discussing:
https://www.soundradix.com/products/pi/
Regarding messing with the phase -- I would really have to listen to that device and listen to how it is used to give it a yay or nay.  The reason for my attitude is dealing with my precious copy of DolbyA encoded ABBA UNMASTERED.   So, I have as pure as one can get without having access to the multi-track master (please don't ask me how I got that material -- I TRULY CANNOT REMEMBER -- it has been over a decade -- and my memory has been damaged.)
I love the ABBA music, but cannot stand the chaos in some of the recordings -- it has taken me over 1yr to figure out why they sometimes sound so bad -- they are damaging the sound quality by playing too much with the phase.
There is a lot of discordant (sp?) material in the 90degree (and 45 degree -- in between -- but really kind of the same thing) directions, making the sound ugly.  When blindly adding stuff to the quadrature, it does things that the ears aren't used to -- and causes an unevenness in sound.   By doing simple summing on semi-random material -- it is probably safer.  By messing with the phase in a non-physically real way -- it can cause problems.  (Of course, there are phase shifts all over the real-world, but a NON-ANALYTICAL type audio signal is what I am speaking of...   An analytical signal is closer to real world, and is kind of a natural signal.  Some artificial signals violate some of the rules, and sometimes sound bad.)

My guess is that some of the games played by the ABBA recording people were meant to pack more energy into the signal for AM radio (making the music more dense), but on high quality equipment it doesn't sound as good as a simple sum.

Of course, if one does bias the input (by increasing the correlation between the sources to be added), then odd things can happen, and then using phase tricks might maintain more of each source -- buuuut -- the ears are not really used to hearing that kind of game.   The natural mix of real and quadrature parts of a signal becomes too violated, and it does give a disrupting effect to the sound.

So, if the phase management software is used to change the phase when it is important to do so (the sources are not fully independent), then it can be helpful.  But, such a device can likely be used for evil also :-).

John
6
Audio Hardware / Searching for a tube amp / compressor
Last post by oo131193oo -
Hello   : ),

I am searching for one stereo or two mono tube amp/comp, to use with 2x JBL LSR305 monitors.
My location for search/buy is germany. I prefer looking for it on ebay (Because i don't know other platforms.)
I will have enough money in next Month(may) to buy it for up to 200€.

Would be nice if some of you who are experts.. on this topic could help me out.
I want to be able to make it sound "nicer", "warmer", and more dynamic (like inflated for example with an voxengo Elephant VST
 , which i'm using at this moment--> But i want Hardware (for sound quality and reliability...)

thanks  ::)
7
Scientific Discussion / Re: Audio Summing Algorithm
Last post by polemon -
@antony96 when adding samples: when you're adding two discrete time samples, you just add them like that.

Samples will either constructively or destructively interfere, that is perfectly normal and it happens in the real world all the time. You must then scale your envelope in case you want keep things from clipping, in case you want to ensure a non-clipped signal. Also keep in mind the type of signal we're talking here. Technically, you want your values to be in a manageable domain, like signed float, so they can be added beyond an imposed top-level. I.e. effectively using arbitrary precision, etc. When it comes to signal processing, it's much better (imo) to think of it purely as a mathematical construct. Whatever you want to then quantize to put it as PCM values into a file, is to be decided /after/ you're done with your signal processing as such. This is especially important when you're designing signal path circuits with active filters and suchlike.

In case you need a better mental image, make sure you're working on a signed, float basis, this actually represents a "natural" signal, unrelated to technical "technicalities" the closest.

In case you need a better representation of such signals, think of brightness levels in pictures, each line in an image is essentially a one-dimensional signal (assuming it's grayscale), etc.

If you wanna try things out, Octave comes with a bunch of pre-made function for discrete-time signal summation, and loads of other functions. So do some playing around with that, and you'll learn a lot by simply trial and error.

A nice beginner's cheat-sheet: https://en.wikibooks.org/wiki/Digital_Signal_Processing/Discrete_Operations

Not sure if it makes sense getting more technical, but if you are interested in LTI systems, and signal processing in general, it's a good idea to start with simply the nomenclature, learn what convolution is, and what it represents, etc.
Whether you want to go into Laplace and Fourier transform, I'd suggest getting to grips with the basics, first.

You might also wanna browse a bit around on: https://dsp.stackexchange.com/
Especially when it comes to the more mathematical aspects of signal processing, it's a good place to get help, etc.

You might also wanna check out university coursework material, like this one: http://web.eecs.umich.edu/~fessler/course/451/l/pdf/c1.pdf
8
Scientific Discussion / Re: Audio Summing Algorithm
Last post by knutinh -
ziemek.z:
care to post a few samples with the sources and results of this mixing approach? (I presume you have some software implementation at hand)
also including what happens when you mix a signal with silence and then adjust the gain to match the volume — does that produce a result that's (audibly) different from the source?
if you arbitrarily change phase across time, it could be possible that this distortion could be noticed… hard to tell without samples though.

> However, if you're doing musical stuff, that effect is unwanted
this effect is completely fine and it won't matter in practice if you are mixing uncorrelated signals, such as different instruments. it just means if you are duplicating tracks in your DAW for some reason, or recording a single instrument with several mics at the same time, then you need to think a bit more to do stuff correctly.
and it is what will happen in the air/ears anyway if you are listening to several natural sound sources, too.
This software seems to be in the area that you are discussing:
https://www.soundradix.com/products/pi/
9
Scientific Discussion / Re: Audio Summing Algorithm
Last post by jsdyson -
If you care about the quality even in the slightest, then clipping is unacceptable.
If clipping is unacceptable and you need an universal solution, then there's no other choice than to divide everything by the maximum possible sum of peak levels. (And if they are 1.0 for all streams, then it's simply the number of streams). Because this is the maximum gain which cannot clip under any circumstances.
If you don't need an universal solution, then it's up to the user to choose the gain.
This is quite simple IMO; you are making it more complicated.

Quote
3) If you are summing totally independent sources (e.g. multiple bands of frequencies that do not overlap), then the sqrt(N) rule comes closer to correct.
Nope it doesn't; actually the opposite.
It's easily tested by summing 2 pure sine waves with different frequencies.
This test shows that "multiple bands of frequencies that do not overlap" is not enough; it's also easy to show that it's not necessary too.
Note that I always qualified by an implied statistics disclaimer.   Yes -- if you purposely bias the experiment, then the results that I suggested would be more towards the worst case.  Please note that I was implying a lack of bias.
By giving SPECIFIC examples, you purposefully created bias -- and even though you probably didn't realize it, you didn't disagree with me -- but probably only meaning to be DISAGREEABLE.

Just use the more typical (average) example where music was being used for the material in question -- most likely due to the learning nature of the individual and the context of this environment...  My statement about the statistics remain accurate...  That is, even though you didn't know that you weren't disagreeing.

John
10
3rd Party Plugins - (fb2k) / Re: [Not my release] foo_uie_panel_splitter
Last post by fabiospark -
Yes, I did some test in that direction but it doesn't work.
The auto wrapping takes into account the spaces in the text to break it,
so you would have to write an "auto wrap mokup" to know how many lines
the text will be brocken into.

I did that some time ago for the track info panel and the OSD but it's
a pain in the neck and each component required slight adjustments
so I don't think it could be automatically transferred to PSS.

On top of that, PSS has its auto wrapping feature that makes things easier.

Thanks.
SimplePortal 1.0.0 RC1 © 2008-2018