Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: [Invitation] Listening test (Read 9177 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[Invitation] Listening test

Hey, guys.

Some codecs like ADPCM use 12 Bit PCM as the source and then code it with 4 or 8 bit in a difficult-to-describe way.

I developed a little codec for .wav, it's very simple: You take your 16 Bit .wav files, turn them down by 24 db, make them into MS-Stereo and store it with flac.

This method give compression rates of 2.6-2.8, far better than ordinary flac.

But i now wonder if you people can hear the difference between 12 Bit MS-.wav and 16 Bit LR-.wav.

So I developed this little program here:

Code: [Select]
file.s = OpenFileRequester("Please enter a 16 Bit 44100Hz Stereo PCM .wav file", "", "Wave files (*.wav)|*.wav|All files (*.*)|*.*", 0)

If file
  If ReadFile(0, file)
    
    Lof = Lof(0)
    *MemorySource = AllocateMemory(Lof)
    ReadData(0, *MemorySource, Lof)
    CloseFile(0)
    
    *MemoryTarget = AllocateMemory(Lof)
    
    For Offset = 0 To 47
      PokeB(*MemoryTarget + Offset, PeekB(*MemorySource + Offset))
    Next
    
    For Offset = 48 To Lof Step 4
      wordL.w = PeekW(*MemorySource + Offset)
      wordR.w = PeekW(*MemorySource + Offset + 2)
      
      wordM.w = (wordL + wordR) / 2
      wordS.w = wordM - wordL
      
      wordM / 16
      wordS / 16
      
      PokeW(*MemoryTarget + Offset, (wordM - wordS) * 16)
      PokeW(*MemoryTarget + Offset + 2, (wordM + wordS) * 16)
    Next
    
    Storefile.s = SaveFileRequester("Where to store your 12-Bit-MS-edited .wav file?", file, "Wave files (*.wav)|*.wav|All files (*.*)|*.*", 0)
    If CreateFile(0, Storefile)
      
      WriteData(0, *MemoryTarget, Lof)
      MessageRequester("Okay!", "Job well done. Check your newly created .wav file and do a double-blind-test! Thanks!")
      
    Else
      MessageRequester("", "Can not write into selected file.")
    EndIf
    
  Else
    MessageRequester("", "Can not read from file.")
  EndIf
EndIf


It's a encoder/decoder within the RAM-memory of your PC. If you want to know how exactly it works, take a look at the code or send me a PM, I'll tell you everything.

Now I would like you to first download the demo of PureBasic (Website) and install it. Then copy and paste my code and run it. Find an original .wav file, wait a few seconds and then store the edited file. It is neither a virus, nor a trojan, but i can not guarantee that it will work properly. Maybe you will get an error message, if so please tell me!

When everything works fine, please do a double blind test with the 12 bit-MS Stereo-.wav files and the original files. Then post your results.

Thanks in advance!

PS: Please also tell me wheter you compared the louder parts of your music file or the beginning/ending/less loud parts. Thanks.

[Invitation] Listening test

Reply #1
You may want to look into lossyflac, which is a similar idea, but uses a variable number of quantization levels depending on the input signal power spectrum. 

BTW, flac already does M/S stereo, so you probably reduce compression efficiency somewhat by preprocessing it that way.

[Invitation] Listening test

Reply #2
I just did a test with 6 Bit ( to really hear the difference in the noise) and the result was equality. Both files, one with LR-material, the other one with MS-material, had more or less the same compression rate, BUT the MS-signal sounded a bit better imo. I used 6 bit for the LR-signal and 7 bit each for the MS-Signal (because Left+Right > Amplitude(Left) | Amplitude(Right)).

[Invitation] Listening test

Reply #3
I used 6 bit for the LR-signal and 7 bit each for the MS-Signal (because Left+Right > Amplitude(Left) | Amplitude(Right)).


So the MS is 7 bit and LR is 6 bit?  If so, yes, I would expect the MS file to be better by about 6 dB

[Invitation] Listening test

Reply #4
So the MS is 7 bit and LR is 6 bit?  If so, yes, I would expect the MS file to be better by about 6 dB


But that's not the case. As i experienced here, the MS-Mid-Signal always deserves one bit more then its LR-components. The noise pitch of MS-Stereo 7 bit was not lower than the 6-bit LR-Signal, it was just more enjoyable, due to the fact that one half of the noise was stereophony-dependant (the side channel).

And still the compression ratio with flac was almost the same, not so different as one would expect from a 6-to-7-bit difference.

btw if somebody would like to do the test, here is an executable made from the code above: http://web44.srv2.domainbase24.com/CLAmaker.exe

[Invitation] Listening test

Reply #5
So which is which? You first reduce the bits and then compress to Mid-side, or you first convert to Mid-Side and then reduce the bits?  One would expect that a lossless codec is lossless, so I see no way for flac to make one sound better than the other.

[Invitation] Listening test

Reply #6
So the MS is 7 bit and LR is 6 bit?  If so, yes, I would expect the MS file to be better by about 6 dB


But that's not the case. As i experienced here, the MS-Mid-Signal always deserves one bit more then its LR-components.


I don't see how this follows from what is in that thread.

And still the compression ratio with flac was almost the same, not so different as one would expect from a 6-to-7-bit difference.


I don't really understand that programming language, but it looks to me like you don't round your M/S calculation, which is probably why its SNR is worse than it should be.

[Invitation] Listening test

Reply #7

So which is which? You first reduce the bits and then compress to Mid-side, or you first convert to Mid-Side and then reduce the bits?  One would expect that a lossless codec is lossless, so I see no way for flac to make one sound better than the other.


He is comparing M/S coded audio truncated to 7 bits to L/R coded audio truncated to 6 bits.  I don't think the FLAC part matters.

[Invitation] Listening test

Reply #8
You may want to look into lossyflac, which is a similar idea, but uses a variable number of quantization levels depending on the input signal power spectrum. 

BTW, flac already does M/S stereo, so you probably reduce compression efficiency somewhat by preprocessing it that way.


Exactly my thought. Just trashing all resolution to 12 bits without even rounding will reduce overall resolution. Especially with fade in/out this will be noticable. Lossyflac (LossyWAV preprocessor) does this in a much more dynamic an optimized way. It really checks every block of 512 samples and will pick the right resolution without harming the sound. Even in de most extreme setting it will hardly, if even noticable degrade the sound.

I have yet to see anyone to ABX a normal song processed by LossyWAV.

I'm still looking for a 'killer' sample that even an untrained ear can distinguish. There is 1 sample that gives véry slightly different results but these are almost unnoticable.

[Invitation] Listening test

Reply #9
I found out I made the mistake to use "-8" in flac in combination with Lossywav. Now I use Flac with the "-8 -e -b 512" parameter and that results in an even lower bitrate 

"-e" is significantly slower and the effect is minimal, but I have enought CPU's available.

I'm considering using Lossywav in it's standard S setting in combination with Flac and 512 blocksize. Just that step, transcoding my entire collection... hmmmm.... 

[Invitation] Listening test

Reply #10
There is 1 sample that gives véry slightly different results but these are almost unnoticable.
Have you shared this sample somewhere? If not, can you please? Thanks.


nhash,

If you're interested in this kind of compression just for the fun of it, you should google NICAM.

Cheers,
David.

[Invitation] Listening test

Reply #11
I found out I made the mistake to use "-8" in flac in combination with Lossywav. Now I use Flac with the "-8 -e -b 512" parameter and that results in an even lower bitrate 

"-e" is significantly slower and the effect is minimal, but I have enought CPU's available.

I'm considering using Lossywav in it's standard S setting in combination with Flac and 512 blocksize. Just that step, transcoding my entire collection... hmmmm.... 


At compression level 8, the added -e makes very little difference.  It is noticeable at lower compression levels though.  Read this thread, or better yet the mailing list, for possible changes to presets to include -e automatically:
http://www.hydrogenaud.io/forums/index.php?showtopic=106545

[Invitation] Listening test

Reply #12
There is 1 sample that gives véry slightly different results but these are almost unnoticable.
Have you shared this sample somewhere? If not, can you please? Thanks.


nhash,

If you're interested in this kind of compression just for the fun of it, you should google NICAM.

Cheers,
David.


That was a sample mentioned here before, or in the lossywav topic. Not one I found myself.
Was like herding_calls or something.