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

Incorrect display of peak frequencies #20

Open
konsib opened this issue Feb 21, 2018 · 1 comment
Open

Incorrect display of peak frequencies #20

konsib opened this issue Feb 21, 2018 · 1 comment

Comments

@konsib
Copy link

konsib commented Feb 21, 2018

Hello,

Thank you for your wonderful program!
Unfortunately I faced inexplicable effect when using it.

In Android Studio I started your application (version 1.6.9). To demonstrate the effect at the same time, I launched Windows application Oscilloscope 2.51 in the FFT mode (screenshots are in the attached zip-file).

I connected the device (generator) to the microphone input of the computer (screenshot 1). As you can see, the view is very strange: the spectrum decreases approximately at a frequency of 3700-4000 Hz.

Then I began to increase the frequency of the signal (screenshot 2). Everything works fine (peak frequencies are very close) right up to a frequency of about 37xx Hz on which there is an incomprehensible effect (screenshot 3): please pay attention - peak values differ dramatically. Next (screenshot 4), the differences in peak frequencies become even greater.

Could you please explain me why this is happening? Maybe it's a bug in the application?

Thank you.

P.S.
Oscilloscope 2.51 displays the peak frequencies correctly.
screenshots.zip

@bewantbe
Copy link
Owner

bewantbe commented Mar 6, 2018

Hi!

Thank you for using my app.

I would guess that these artifacts are due to the emulator, not the app itself.

For screenshot-1.

I can see two noise floors. The higher one (around -54dB) should relate to the noise in the mic, the lower one (around -120dB) should relate to the anti-aliasing filter which limit the signal to 4kHz, and that means, maybe somewhere in the audio processing pathway, 8kHz sampling rate is assumed.

Your experiment further verified the existence of this 4kHz low-pass filter, because when input frequency is higher than 4kHz, the peak frequency no longer matches.

For screenshot-2, screenshot-3, screenshot-4.
The -120dB floor disappeared, which is weird, if the audio processing method didn't change and no automatic gain control applied, then it indicate recorder buffer overrun, which will leads to discontinuous samples and the slow-decaying spectrum.

Another possibility is, although not so sure about this, clipping in the input signal, so reduce the volume (hardware or software) may help.

I would suggest first turn on the "overrun warning" in the app preference, see if there is overrun. Also reduce input signal amplitude or volume.

I also tried it in the emulator (along with the Android Studio, in Linux), everything looks good. But I remember that in the old day (e.g. 4 years earlier), the running speed of the emulator is not fast enough so that there is constantly buffer overrun.

I notice that you are using "Lollipop" image, and Lollipop is released in November 2014. Consider update it and see if it works.

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