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

Non-linear mouth mapping? #10

Open
BobGlicksman opened this issue Jan 21, 2021 · 4 comments
Open

Non-linear mouth mapping? #10

BobGlicksman opened this issue Jan 21, 2021 · 4 comments

Comments

@BobGlicksman
Copy link
Owner

As of 1/21/21: The mouth movement circuitry and test firmware appears to be working as designed. The servo-mouth definitely moves in synch with a spoken MP3 clip. There is a perceptual time lag as you average more samples, as expected. However, the mouth movement, while in synch with the audio, is not very convincing. I have noted that a "small" drop in audio sound level results in a seemingly much larger drop in mouth movement. I THINK that this may be due to the fact that human hearing is logarithmic whereas the sound (envelope) level mapping to servo movement is linear. Realism MIGHT be improved by some non-linear mapping of sound (envelope voltage) to servo movement which emphasizes low value sound samples more than high volume sound samples. Perhaps something like a 4 point linear mapping of A/D values to servo commands would work:

  1. Divide the mapping range (High - Low) of input A/D values into 4 equal sub-ranges.
  2. Multiply the lower range sound values by 4, the mid-low range sound values by 3, the mid-high range sound values by 2, and the high range sound values by 1.
  3. scale the mapped values to the servo movement range.
@BobGlicksman
Copy link
Owner Author

I added a call to a non-linear scaling function (firmware v1.2). This scaling function uses the sqrt() function from the Math library - mostly for convenience. It does appear to add realism to the moth movement. However, there still seems to be some tendency for the mouth to not pick up the last syllable all of the time. I don't know why this is -- it is not simply a matter of voice volume dropoff. Perhaps the mini-MP3 BUSY line sometimes drops a little too soon? Perhaps the last bit is on the wrong track of the MP3 file (not the one playing through the analog processor), albeit I think that the recording is monaural.

@jschrempp
Copy link
Contributor

I added nlp2 with this algorithm and it seems to look good. Unsure why it does the job better than nlp1.

  averagedData = sqrt(averagedData) / sqrt(maxValue) * maxValue;

@jschrempp
Copy link
Contributor

I think we can close this issue now.

@BobGlicksman
Copy link
Owner Author

BobGlicksman commented Nov 4, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants