Giter Club home page Giter Club logo

Comments (14)

bewantbe avatar bewantbe commented on August 27, 2024

Yeah, there are currently only linear frequency axis.

I seriously agree that having a logarithmic option will be quite useful. It's one of the top two TODO in my mind. (The other one would be to have a more user friendly GUI)

But on the other hand, it's not a very easy thing. Because current code (the drawing part) is tightly rely on the linear axis setup.

Especially the spectrogram part, internally it is a bitmap that one pixel correspond to one frequency point (at a time point). For logarithmic axis, this one-to-one mapping does not exist. It seems that I have to re-generate the graph (and involve image interpolation) every time the scale changes which is expensive. Any idea about how to implement this part is welcome.

from audio-analyzer-for-android.

YevgenBarsukov avatar YevgenBarsukov commented on August 27, 2024

I would also be very interested in logarithmic axis. Main benefit is that for musical application this will directly map to a note-stand since it is logarithmic itself.

Regarding keeping it is a bitmap, I think it can be easily solved - just make logarithmic conversion to each point before you add it to the bitmap. In this case all the values will still stay as bitmap and there will be one to one correspondence to the screen.

Another feauture I am interested in is ability to chose a frequency range (fmin and fmax) that is displayed on the screen (again useful for musical applications). For example if you only see the lower harmonics of the sound that corresponds to your voice, its is likely to be in 3 or 4 octaves. So you could only look at this range to see more exactly "where" you are in the note-stand with your sound.

Regards,
Yevgen

from audio-analyzer-for-android.

bewantbe avatar bewantbe commented on August 27, 2024

Thanks for your comment, Yevgen.

For the range select feature, it already there. Just use two fingers to zoom it, like zooming an image.

For the logarithm axis part, in zoom out state, you may have multiple frequency points in one pixel (in the very high frequency portion). Then when zoom in, these mixed pixels needs to be recalculate... Besides, the low frequency part need some interpolation, because multiple pixels corresponds to one point (currently I rely on the interpolation transparently performed by the Android system, so no extra code there).

If we use one big enough bitmap so that each point map to different pixel(s), then it would be too large: for m frequency points, it needs m ln(m) pixels.

Maybe this can be solved by piecewise log map...

from audio-analyzer-for-android.

YevgenBarsukov avatar YevgenBarsukov commented on August 27, 2024

I think all this issues are handled in the same way as before if the choice of ln vs lin spacing is done before data is added to bitmap and is irreversible e.g if changed data will be cleared. In this case all interpolation again can be done by OS as point positon to axis lenght relations again remain linear. The base points number from which iterpolation is done remains constant as for N frequencies f we get N values of ln(f).
Of cause if zooming would allow to have more point on sreen some resolution would be lost but this in not specific to log representation but to storing original data in a bitmap. This again could be rsolved by resetting the data after zoom or change of scale event so that resolution in original bitmap could be higher if scale is narrower. To me changing scale sounds like something likely done rarely or once per experiment. For this reason I would also like exact numerical entry for y scale min and max so it can be a permanent setting.

from audio-analyzer-for-android.

YevgenBarsukov avatar YevgenBarsukov commented on August 27, 2024

thinking more about it it could that best to keep both options - finger zoom witout reset by simple interpolation and in options a base scale setting for base scale and log vs lin axis that are applied nefore adding to bitmap and change would require reset of data.

Regards
Yevgen

from audio-analyzer-for-android.

bewantbe avatar bewantbe commented on August 27, 2024

Hi,
The logarithmic frequency axis is added (and also the frequency setting), try the latest revision (commit 905c11a, tag v1.4). See if it works well on your side.

A compiled version is also provided.
audioSpectrumAnalyzer-release-v1.4.zip

I'm still comparing both your and mine idea of about the log axis. Commit 905c11a is using my way (which is complicated).

from audio-analyzer-for-android.

YevgenBarsukov avatar YevgenBarsukov commented on August 27, 2024

Awesome! I installed it and played a little with it.
The log axis itself works well. I also tried to change ranges, and that is where a strange thing happened - when I set lower bound to any new value (I tried 50 instead of original 7.85), the Y-axis gets inverted. Now the high frequencies become on the top and low freqs. on the bottom. I use Y axis as frequency setting.

Regards,
Yevgen

from audio-analyzer-for-android.

YevgenBarsukov avatar YevgenBarsukov commented on August 27, 2024

Sorry I see I even inverted them in my sentence :-) It should read:

Now the high frequencies become on the bottom and low freqs. on the top...

from audio-analyzer-for-android.

bewantbe avatar bewantbe commented on August 27, 2024

Oops, I forgot to deal with the case of setting range when Y axis is frequency... Now it should be fixed, see commit 17e8183
udioSpectrumAnalyzer-commit-17e8183.zip

BTW, that is a funny bug...

from audio-analyzer-for-android.

YevgenBarsukov avatar YevgenBarsukov commented on August 27, 2024

Great! Now orientation works fine, and I can see results of range change.

One issue I noticed with the range settings - when I change them, and than just make the app lose focus by switching to another app, the new setting disappear and it reverts to defaults. This is a bit unpractical because once you set it you would like to keep it as is.
Would it be possible to make them stick, at least until the app is closed, but preferably even when app is restarted, since the same range is likely to be useful?
For example I would like to constantly keep it in "vocal" range starting from C2...

Regards,
Yevgen

from audio-analyzer-for-android.

bewantbe avatar bewantbe commented on August 27, 2024

I do not encounter this problem, I mean the lose of focus cause reset some settings ---- but it can be true since the state saving code is currently a bit broken, I will take care of this.

Make the view range setting persistent is a good suggestion, but the design detail needs some thought... let me see

from audio-analyzer-for-android.

bewantbe avatar bewantbe commented on August 27, 2024

Now there is a "lock" option and a "load previous setting" in view range setting. State saving code should also work as expected.

Check out the latest version (commit e4d3b24).
audioSpectrumAnalyzer-release-v1.5.zip

from audio-analyzer-for-android.

YevgenBarsukov avatar YevgenBarsukov commented on August 27, 2024

from audio-analyzer-for-android.

bewantbe avatar bewantbe commented on August 27, 2024

The Logarithmic frequency axis works, so I think it is proper to close this issue now.
Feel free to open a new issue if you found something wrong.

from audio-analyzer-for-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.