Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Dear All !!
************************************************** ** Any shed of the Kowledge on this will help my me out ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ I am working on the module in which i have to mix the two (audio/speech)files Its look simple to add the each samples of the two diffrent audio file and then write into the Mixed file. But here comes the problem That if i simply add the two diffrent audio files (Each samples) then there may be over flow of the range, so I decided to divide the each sample by two and then add the data and write into the file. what I observed that the resultant mixed wav file whcih I got has the low volume, and this is obvious that as i am dividing the value of each sample by two. So it is decreasing the amplitude level. So I took another Way to mixed the audio files. Let the two signal be A and B respectively, the range is between 0 and 255. Y = A + B - A * B / 255 Where Y is the resultant signal which contains both signal A and B, merging two audio streams into single stream by this method solves the problem of overflow and information loss to an extent. If the range of 8-bit sampling is between ?127 to 128 If both A and B are negative Y = A +B - (A * B / (-127)) Else Y = A + B - A * B / 128 For n-bit sampling audio signal If both A and B are negative Y = A + B - (A * B / (-(2 pow(n-1) - 1))) Else Y = A + B - (A * B / (2 pow(n-1)) Now the aplying the above approach I am geting the good sound qualites for the mixing of the two audio signal. But As I am increasing the number of the files to be mixed then I hear some sort of disturbance (Noise) in it. Means that as the number of the files is increased then the disturbence in the audio mixed file also increases. WHat is the reason behind this ??? Is there is some underlying hard ware Problem or The qualites Of the sound recording depend on the Recording Device ?????????? I want to have some review of your views on this. Personally what I think is that it may due to the folloing factors and that to searching from the net and from You all. 1: Digital computaion error http://www.filter-solutions.com/quant.html 2: Due to aggressinve increase of the amplitude of the mixed file, as we go on increasing the number of the audio files. I.e higher the number of the files the resultant values of the mixed audio fuiles will be increased and will tend towards the higgher range i.e towards 32767 in the case of the positive samples. and will tend towards the -32768 when the two samples of the audio files are negative. { here I am talking about the 16 bit audio data Recorded at the 8KHz sampled } So is there Any other approach So that I can approve my self that the Mixed audio data is Noise Free (At most I have to Mix the 10 Audio Files). One More queery is, what is the reason behind the distortion when the low level recording is done and when we paly the same file. Is there any distortion in it. ????? and in my perception we have the distortion in the recorded and the play back of the same Audio file. For which I am stating my views. (Correct me where ever I am wrong) Explanation 1-- If we have a good A/D-D/A converter also in recording and playback the audio files, Then there comes the picture of the distortion also. we know that the digital recording is extremely accurate due to its (S/N) high signal to noise Ratio. Now Regarding at the low level, digital is actually better than analog, due to its 90 dB dynamic range. The best we can get from phonograph (Recording and Playing software/device) records is around 60f dB. More precise is around 40 dB. we can hear the range of the 120-plus dB. This is why recordings utilize a lot of compression (Compressor-- a electronic device that quickly turns the volume up when the music/speech is soft and quickly turns it down when it is loud). Now here comes the Picture of the compressor which compress and the term Quickly" which means some loss of digital data at the both the ends (High and Low). Since low level Surroundings detail are completely stripped by digitizing when we record at the low level. So the digitizing the low level signal lose the relevent information which result in the distortion. Note : In the Sound cards Use the A/D and The D/A converter and it is involved with the samling frequency and It is not sure that Exact sampling frequnecy is same for the difrent sound cards which may vary and very low level. So which also cause the Distortion at the low level. Explainion 2-- Now suppose If we record the audio data from the one's system(Recording Device) at the low level volume set, in the volume control. such that a sound recorded at the 100% low level of the recording. And when this recorded audio file is played back at the another System at the 100% low level of the volume control and if we dont vary the setting then it will paly the same with out distortion And if there is diffrence in the Volume level control setting at which it s recorded and audio file played back will result in some sort of istortion. Note : If there is variance in the recorded and the played back audio files volume control then also their will be distortion. So for the Low level Recording and listining there will be some distoortion will be seen if we play this low level recorded file into another system at the very high level. Explainnation 3-- Some software and the hard ware Use the Normalisation concept for various algorthim used. Some normalisers are basically "Volme expaders," and some are the "Limiters" They stretch the dynamic range of the material, the low sounds in the original remain low and that to at their original level, while the level of the loudest sounds is raised peak level permiitted by the recording proccess and what eevr lies in between is raised in level pro-portionately. (Addaptive increase), Which also cause the distortion of the original recorded sound. Hence to hear the low volumes sounding we have to increase the volume, to hear the lower volumes (soft volumes) parts of audio file, Hence all the enhance signal is also plyaed causing the distortion. Note: Mostaly the sound Recorded under the concept of normalisation at low level can also cause the Distortion. Very High Music and the Speech are recorded at the (Compressor/Expansion) Algorthim which uses the Normalisation. One More Thing what is the Lowest and the upper limit for the recoerding of the 16 bit data 8Khz sampling frquency so that we dont have the NOISE for the same recoerded and the play back audio file. ??????????????? Any shed of the Kowledge on this will help my me out Thanks In Advance Regards Ranjeet |
#2
![]() |
|||
|
|||
![]()
ranjeet wrote:
Dear All !! I am working on the module in which i have to mix the two (audio/speech)files Its look simple to add the each samples of the two diffrent audio file and then write into the Mixed file. snip Regards Ranjeet You have not clearly described what you are doing. If you are mixing the files in analogue format there should not be a problem. If you are mixing the files in digital format, you can't assume you can do a simple addition of byte values. Look for good audio editing packages on the Internet. Any of them should be able to combine your files with minimal if any distortion. |
#3
![]() |
|||
|
|||
![]() I am working on the module in which i have to mix the two (audio/speech)files Its look simple to add the each samples of the two diffrent audio file and then write into the Mixed file. But here comes the problem That if i simply add the two diffrent audio files (Each samples) then there may be over flow of the range, so I decided to divide the each sample by two and then add the data and write into the file. Many audio sequencers work internally at a higher sample rate than that of the files they work on. Maybe this is why. |
#4
![]() |
|||
|
|||
![]()
"Laurence Payne" wrote ...
I am working on the module in which i have to mix the two (audio/speech)files Its look simple to add the each samples of the two diffrent audio file and then write into the Mixed file. But here comes the problem That if i simply add the two diffrent audio files (Each samples) then there may be over flow of the range, so I decided to divide the each sample by two and then add the data and write into the file. Many audio sequencers work internally at a higher sample rate than that of the files they work on. Maybe this is why. Or perhaps a greater bit-depth (24-bit internal computation, and perhaps even floating-point rather than integer arithmetic.) |
#5
![]() |
|||
|
|||
![]()
On Tue, 28 Dec 2004 07:46:12 -0800, "Richard Crowley"
wrote: Many audio sequencers work internally at a higher sample rate than that of the files they work on. Maybe this is why. Or perhaps a greater bit-depth (24-bit internal computation, and perhaps even floating-point rather than integer arithmetic.) My mistake. I meant higher bit-depth. |
#7
![]() |
|||
|
|||
![]() Barry Mann wrote: In , on 12/26/04 at 09:16 PM, (ranjeet) said: [ ... ] what I observed that the resultant mixed wav file whcih I got has the low volume, and this is obvious that as i am dividing the value of each sample by two. So it is decreasing the amplitude level. By dividing by two you are throwing away one bit of resolution. Quiet passages may have only had three or four bits to begin with, throwing one of them away is very unfortunate. After a few generations of this, there may be nothing left of the original samples. You could temporarily convert the 8-bit files to 16 or 24-bits. If you can, use extended precision calculations (32 or 48-bits -- or more) during the mixing process, then pare the final mix down to 8-bits. Extended precision routines will take longer, but you are less likely to suffer some sort of truncation problem. Rather than mix your 10 files two at a time, try to find (or write) some software that will work on more files on a pass. Hopefully, this software will use appropriate precision. The point that all of you are missing is that the very act of truncating the final sum is what is causing the problem. Doing so introduces pretty serious truncation artifacts, ESPECIALLY if you're only doing 8 bits worth of precision to begin with. If you are going to take a loinger precision word and truncate, you HAVE to dither, otherwise you will be getting exactly the effects described by the original poster. While dithering will raise the overall noise floor, done properly, you will not have the severe distortion artifacts described. Dithering is the addition of a small amount of random noise, on the order of about +-1/2 LSB of the final result BEFORE tunrcating. If it were me (and I have done this sort of thing for a number of clients in the past), I'd use a combination of dithering and simple first-order residue noise shaping. Assume, for the moment, that a series of 8 bit values have been added together and that the sum lives in a 16 bit integer (we'll assume two's complement representation for the time being). We'll further assume that the significant data resides in the top 8 bits, and we want to truncate down to 8 bits, discarding the bottom 8 bits. We just can't discard them, becuase it represents real data (and doing an integer divide IS discarding these lower bits: don't do that!) Let's further assume we have good quality random number generator that will generate an 7 bit signed random number, and we have a local static storage for a 16 bit signed value. Now, each time you need to convert a 16 bit to an 8 bit sample, first add in the value of the residue (whose initial value is 0). Then add in a random 7 bit value. NOW get rid of the bottom 8 bits, and that's left is your 8 bit dithered sample in the top 8 bits of your 16 bit value. BUT, before you do anything else, subtract that trincated value from the original, and store the result in the local static residue for the next sample. Repeat for each subsequent sample. You can tweak the amount of random noise vs the amount of residue you use until it soiunds right for your application, but this should help your cause quite a bit. |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Fatal flaw in Sennheiser h'phone cords ? | Pro Audio | |||
Roland XP60/80 Decay Flaw Fix | Pro Audio | |||
FLAW in test!! Subwoofer direction | Car Audio |