Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voice System #2

Closed
laqieer opened this issue Sep 5, 2020 · 2 comments
Closed

Voice System #2

laqieer opened this issue Sep 5, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request
Projects

Comments

@laqieer
Copy link
Owner

laqieer commented Sep 5, 2020

4 voices (map / damage / status / attack) per character to save space.

@laqieer laqieer added the enhancement New feature or request label Sep 5, 2020
@laqieer laqieer self-assigned this Sep 5, 2020
@laqieer laqieer added this to To do in Voice via automation Sep 5, 2020
laqieer added a commit that referenced this issue Sep 5, 2020
@laqieer laqieer moved this from To do to In progress in Voice Sep 5, 2020
@laqieer laqieer closed this as completed Oct 7, 2020
Voice automation moved this from In progress to Done Oct 7, 2020
laqieer added a commit that referenced this issue Oct 6, 2021
laqieer added a commit that referenced this issue Oct 12, 2021
@laqieer
Copy link
Owner Author

laqieer commented Oct 12, 2021

The sound quality is improved by changing sampling frequency from 5734 to 10512. The DPCM compression reduces the increase of ROM size. The size only increases 1.35MB.

SNR-frequency relation:
image
In theory, lower sampling frequency => less sampling points => greater distance between points => more quadratuer error => lower SNR

SNR distribution when frequency = 10512:
image
In theory, when digitizing sound, it has been found that you must use a sampling rate of twice the highest frequency of sound that you want to digitize in order to accurately reproduce the sound. This is called Nyquist’s theorem. The human speaking voice typically has frequencies of up to 4000 Hz, so a sampling rate of 8000 Hz is sufficient to sample it with an acceptable quality. This is why a sampling frequency of 8 kHz is often found within codecs used for VoIP. GBA accepts sampling rates (Hz): 5734, 7884, 10512, 13379, 15768, 18157, 21024, 26758, 31536, 36314, 40137, 42048. Therefore we choose 10512 (>8k) here.

SNR distribution when frequency = 5734:
image
The quality is too poor for lowest frequency 5734, though it saves ROM space.

ROM size (KB) with min-SNR limit when frequency = 5734:
image
The size increases significantly after SNR = 5, so we set min SNR for compression to 5.

In conclusion, I think the current default parameters is good.

FREQ = 10512
SNR = 5

laqieer added a commit that referenced this issue Oct 12, 2021
…mpiler found in /Applications/Docker.app/Contents/Resources/bin:/usr/local/opt/[email protected]/bin:/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/bin:/Users/zhuzhiwen/Downloads/mGBA-0.9.2-osx/bin:/Users/zhuzhiwen/Downloads/NanoboyAdvance-1.3-macOS:/Users/zhuzhiwen/Library/Developer/Xcode/DerivedData/ck-aiqyhvsyeghbigcjqgdjeztcpurz/Build/Products/Debug/:/Users/zhuzhiwen/Downloads/cparser/build/debug:/Users/zhuzhiwen/.cpan/build/Graph-Easy-0.76-A4N92d/blib/script:/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home/bin:/Users/zhuzhiwen/Downloads/retdec/bin:/Users/zhuzhiwen/Downloads/agbcc:/opt/devkitpro/devkitARM/bin:/opt/devkitpro/tools/bin:/Users/zhuzhiwen/.nvm/versions/node/v14.15.5/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/opt/X11/bin:/opt/devkitpro/tools/bin:/Library/Apple/usr/bin:/Users/zhuzhiwen/.dotnet/tools:.. #2.
laqieer added a commit that referenced this issue Oct 12, 2021
laqieer added a commit that referenced this issue Oct 12, 2021
laqieer added a commit that referenced this issue Oct 12, 2021
@laqieer
Copy link
Owner Author

laqieer commented Oct 12, 2021

Correction: laqieer/se2m4a@8082dc1

SNR-Freq
test script: https://github.com/laqieer/se2m4a/blob/master/tool/test_frequency_and_SNR.py
test data:

test_data/VOICE_Abel_The_Panther_ATTACK_1.wav
test_data/VOICE_Abel_The_Panther_ATTACK_1_jp.wav
test_data/VOICE_Abel_The_Panther_ATTACK_2.wav
test_data/VOICE_Abel_The_Panther_ATTACK_2_jp.wav
test_data/VOICE_Abel_The_Panther_DAMAGE_1.wav
test_data/VOICE_Abel_The_Panther_DAMAGE_1_jp.wav
test_data/VOICE_Abel_The_Panther_DAMAGE_2.wav
test_data/VOICE_Abel_The_Panther_DAMAGE_2_jp.wav
test_data/VOICE_Abel_The_Panther_DEAD_1.wav
test_data/VOICE_Abel_The_Panther_DEAD_1_jp.wav
test_data/VOICE_Abel_The_Panther_MAP_1.wav
test_data/VOICE_Abel_The_Panther_MAP_1_jp.wav
test_data/VOICE_Abel_The_Panther_MAP_2.wav
test_data/VOICE_Abel_The_Panther_MAP_2_jp.wav
test_data/VOICE_Abel_The_Panther_MAP_3.wav
test_data/VOICE_Abel_The_Panther_MAP_3_jp.wav
test_data/VOICE_Abel_The_Panther_SKILL_1.wav
test_data/VOICE_Abel_The_Panther_SKILL_1_jp.wav
test_data/VOICE_Abel_The_Panther_SKILL_2.wav
test_data/VOICE_Abel_The_Panther_SKILL_2_jp.wav
test_data/VOICE_Abel_The_Panther_SKILL_3.wav
test_data/VOICE_Abel_The_Panther_SKILL_3_jp.wav
test_data/VOICE_Abel_The_Panther_SKILL_4.wav
test_data/VOICE_Abel_The_Panther_SKILL_4_jp.wav
test_data/VOICE_Abel_The_Panther_STATUS_1.wav
test_data/VOICE_Abel_The_Panther_STATUS_1_jp.wav
test_data/VOICE_Abel_The_Panther_STATUS_2.wav
test_data/VOICE_Abel_The_Panther_STATUS_2_jp.wav
test_data/VOICE_Abel_The_Panther_STATUS_3.wav
test_data/VOICE_Abel_The_Panther_STATUS_3_jp.wav
test_data/VOICE_Abel_The_Panther_STATUS_4.wav
test_data/VOICE_Abel_The_Panther_STATUS_4_jp.wav

A related research

freq = 5734:
Figure_1
26426072 10 12 18:02 FEHRG.gba

freq = 7884:
Figure_2
27225664 10 12 18:41 FEHRG.gba

freq = 10512:
Figure_3
28203312 10 12 18:21 FEHRG.gba

freq = 10512 & SNR >= 15:
Figure_4
28222992 10 12 18:48 FEHRG.gba

laqieer added a commit that referenced this issue Jan 10, 2022
laqieer added a commit that referenced this issue Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Voice
  
Done
Development

No branches or pull requests

1 participant