fulldecent / formant-analyzer

iOS application for finding formants in spoken sounds
https://fulldecent.github.io/formant-analyzer/
MIT License
57 stars 15 forks source link

Redraw vowel plot using native graphics primitives #22

Open fulldecent opened 5 years ago

fulldecent commented 5 years ago

Currently the vowel plot is drawn using a rendered picture.

This can be improved to use actual drawing primitives.

yaroslav-zhurakovskiy commented 5 years ago

vowelPlotBackground

I can draw the grid, but what about the colored ovals? Using what principles should they be drawn?

fulldecent commented 5 years ago

Cool. You can model like this:

(centerF1, centerF2, slope, majorLength, minorLength, letter, color)

And then adjust so it looks approximately like the graphic above.

Actually these are subjective items so being off by a few Hz is not a problem.

yaroslav-zhurakovskiy commented 5 years ago

Ok. What are these variables? I don't see how they are calculated. Can you give me at least some link, so I can read about it.

fulldecent commented 5 years ago

Here is some reading:

https://ccrma.stanford.edu/~jmccarty/formant.htm

https://www.phon.ucl.ac.uk/home/wells/formants/relamp-uni.htm


I am just guessing one of the variable sets

(centerF1=350, centerF2=800, slope=20, majorLength=700, minorLength=200, letter=u, color=green)

I am just estimating.

Or if you have another recommendation we can try that.

69660131-4eb06080-1088-11ea-995e-e0283a2c96c1

yaroslav-zhurakovskiy commented 4 years ago

I was thinking may be we should rather use https://github.com/i-schuetz/SwiftCharts instead of building a plot view from scratch? Building such a view ourselves will be tedious and will take a lot more time.

fulldecent commented 4 years ago

It seems that library does not support logarithms or a detached axis (500 is the minimum)

This is not really a chart. it is just a dot on top of a picture. Right now the picture is a PNG. We do not need a full chart library. For example the scale will never change. This can probably be done in SwiftUI nicely.

fulldecent commented 3 years ago

An easier starting point here would be a graphic like the "Formant estimation" on https://en.wikipedia.org/wiki/Formant

The bounds for the graphic will always be 0–1200 for X and then 500–4000 for Y. Other things get plated on the chart.

The data "Average vowel formants for a male voice" on Wikipedia are also good to use as a starting point.