ptwz / python_wizard

Command line LPC analysis tool to generate bitstreams for the Texas Instruments TMS5220 chip
MIT License
40 stars 13 forks source link

Sound quality : lower than BlueWizard #5

Closed deladriere closed 6 years ago

deladriere commented 6 years ago

I noticed that the sound produced with python_wizard are never as good as the one produced by BlueWizard with the same parameters. Is this normal? I saw the commits in the cleanup branch. Are you working on this issue?

I love to use python_ward because I can batch process a text file, have each of the lines converted to wav (via Say), process them with python_wizard and then directly send the LPC stream to the Arduino via py_serial for an instant quality check.

ptwz commented 6 years ago

Ok, I will look into it. Is there a pattern like vowels or th's or unvoiced things? So I can focus my debugging a bit.. Seems pywizard/Buffer.py:95 is the culprit, the pitch estimator seems a bit odd. Don't know what I did there...

ptwz commented 6 years ago

The preliminary fix seems to raise some warnings, which I would like to look into. But it seems to increase the sound quality a lot. Please check it out and give me some feedback.

deladriere commented 6 years ago

Ok thanks a lot !!! . I will try tomorrow and process the same audio into both Bluewizard and Python_wizard

deladriere commented 6 years ago

Thanks, I checked and I achieved almost the same results with both Bluewizard & PythonWyzard. By the way, they both seem to sound better in English with Alex than it does in German with Markus or Yannick! I think the quality is in fact related to the Arduino part of the system. The live player from Blue wizard sound much better than the Arduino does: maybe there is something to learn from the decoder part of the code to port to the Arduino?

ptwz commented 6 years ago

Indeed the TMS emulator in BlueWizard is quite a beast. I think this is something for the DSP gurus to port ;).

deladriere commented 6 years ago

Sorry I must have made a mistake testing the different versions

I had to revert back to a8bddd171ce42bca9e5826721997a8905932ddfb (dec 3)

Here is the same sound processed by :

a) Blue_wizard 60,80,23,43,03,70,7c,8b,03,b6,1f,4d,51,0b,26,26,11,ba,85,25,72,58,94,e4,16,e4,a4,19,d6,56,5a,94,8b,a6,7b,5b,6e,49,49,5a,92,6d,b9,e5,25,69,49,8c,ed,54,96,28,29,5e,b6,5d,39,a8,4b,b8,c6,52,c0,b3,a9,0e,38,b1,dc,00,db,47,86,b6,d1,8a,74,b1,13,86,50,32,55,d3,49,18,43,8f,e4,48,d5,61,0c,b9,5c,2a,62,bb,29,94,34,3d,8d,1a,a6,18,2a,68,2d,6c,98,b2,c9,e2,b2,22,6e,2e,26,4a,c2,8a,b8,a5,38,4f,36,0b,a5,e6,62,dc,d0,34,b2,98,4b,72,07,2f,33,62,2d,3e,9c,d5,4d,b1,a5,9a,08,36,b3,8c,e6,6e,2c,45,dd,0a,3c

b) dec3 10,f0,23,43,3d,b5,52,c1,8e,1f,49,93,d9,09,dd,7e,b4,54,26,a7,b0,05,57,d3,08,dd,82,12,25,2c,4a,72,0b,73,d2,0c,6b,2b,2d,ce,45,d3,bd,a3,b4,b4,24,2d,c9,b6,d2,f2,9a,b4,24,c6,4e,2a,4b,94,14,2f,db,ae,1a,cc,25,5c,63,b9,e9,d9,54,0f,4d,9c,b0,13,cb,2b,3c,49,40,b6,8f,f4,74,3b,a1,6d,b4,22,43,ec,86,31,94,4c,d5,74,12,c6,d0,23,39,52,4d,98,42,2e,97,8a,d8,6e,0a,25,4d,4f,a3,86,29,86,0a,5a,0b,1b,a6,6c,b2,b8,bc,88,9b,8b,89,92,b0,22,6e,29,ce,93,dd,42,a9,b9,58,77,34,8d,2c,e6,92,dc,c1,cb,8c,58,4b,48,17,73,53,6c,69,26,52,cc,2c,a3,a9,5b,4b,51,b7,02,0f

c) actual version 10,f0,23,43,3d,b5,52,41,8f,1f,49,93,d9,09,dd,7e,b4,54,26,27,a6,05,57,d3,08,dd,e0,12,25,2c,4a,72,83,73,d2,0c,6b,2b,0d,c9,45,d3,bd,a3,34,a1,24,2d,c9,b6,d2,e4,9a,b4,24,c6,4e,52,4b,94,14,2f,db,8e,1e,cc,25,5c,63,39,f9,d9,54,0f,4d,9c,c4,13,cb,2b,3c,49,e0,b6,8f,f4,74,3b,a1,6d,b4,22,43,ec,86,31,94,4c,d5,74,12,c6,d0,23,39,52,4d,98,42,2e,97,8a,d8,6e,0a,25,4d,4f,a3,86,29,86,0a,5a,0b,1b,e4,6c,b2,b8,bc,88,53,8a,89,92,b0,22,4e,2d,ce,93,dd,42,29,a5,58,77,34,8d,2c,98,92,dc,c1,cb,8c,d0,4a,48,17,73,53,0c,6a,26,52,cc,2c,23,a8,5b,4b,51,b7,02,0f

As you can hear, the best is Blue_wizard, then dec 3. Actual version of ptwz produces a lot of squeaky sounds

deladriere commented 6 years ago

@ptwz Hi can you reopen this issue ?

ptwz commented 6 years ago

@deladriere Could you upload your example file, so I can debug easier?

deladriere commented 6 years ago

sure : https://www.dropbox.com/s/h0s6jayy662uumv/tesla.wav?dl=0 it says "tesla"

deladriere commented 6 years ago

I tried the last commit from the pitch estimate branch: sounds better it still sounds like whining

10,88,23,43,3d,ad,52,41,8f,1f,49,93,d9,29,ee,a1,cd,25,a2,b4,a0,44,09,f5,92,3c,82,9c,34,c3,db,72,8b,4b,d1,b4,68,2b,2d,2e,49,4b,a2,6d,97,bc,24,2d,f1,b6,ed,f2,c6,43,52,ad,92,9b,af,0e,75,b7,d8,21,b8,b1,bd,d2,d2,04,78,fb,48,4f,8f,13,dc,c2,3b,c2,c5,49,70,43,8b,14,4b,27,21,08,b9,5c,3a,62,bb,20,94,34,3d,0d,1b,82,ac,ab,b9,ad,88,0b,8a,89,92,f4,22,6e,2e,ce,93,dd,0a,a9,b9,58,77,34,8b,2c,e6,92,dc,d1,ca,0c,9b,ab,cb,10,33,4b,64,6e,c6,53,cc,ad,c0,03

I am processing this text

Space oddity Life on Mars ? Starman David Bowie Roadster Elon Musk Falcon Heavy Tesla

Generating the voice with Alex on Mac and streaming the LPC to the Arduino here is the audio recorded from the Arduino :

https://www.dropbox.com/s/gb2lsfopddgyqo8/pitchtest.mp3?dl=0

Thanks a lot for your efforts

deladriere commented 6 years ago

Thanks for this new version it's still winning. check this video to compare with Blue_wizard First, you hear the wave, then the LPC made by Blue_wizard, then I pasted the Python_wizard data into Blue_wizard
test 18-avr-2018

deladriere commented 6 years ago

you can use this audio too to test

deladriere commented 6 years ago

hi @ptwz I found this tutorial about python_wizard https://www.youtube.com/watch?v=fQ4eC_afHf4 It worked fine for me too using the GUI, so I then realized I wasn't using the correct sets of commands in the command line version ! now my command is -u 0.1 -w 2 -S -p -a -1 -m 0.7 -U -u 1 -F 25 -f hex (it would be cool if we could print this command string while playing with the GUI 😄 )

ptwz commented 6 years ago

Thanks for letting me know, I will try to add the command line output in the GUI in a future revision.