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

Not getting Stable Frequency from Tuner #24

Open
jogasinghbajwa opened this issue Jan 21, 2020 · 0 comments
Open

Not getting Stable Frequency from Tuner #24

jogasinghbajwa opened this issue Jan 21, 2020 · 0 comments

Comments

@jogasinghbajwa
Copy link

Frequency Jumping value Issue:

First of all, thank you to all contributors to make such a beautiful library for audio signal processing.
I am working with the TuningFork in Swift language.
I am getting Frequency values using these lines of source code:

` let tuner = Tuner2(threshold: 0.07, smoothing: 100)
tuner.delegate = self
tuner.start()

func tunerUpdate(frequency: Double, amplitude: Double, output: TunerOutput?) {
print(frequency)
DispatchQueue.main.async {
self.frequencyLabel2.text = "(frequency)"
self.frequencyLabel.text = "(output?.frequency)"
}
}
`

I tried to play with the smoothing factor as well, but didn't get the expected result. I know underneath of it, it uses Audio kit class to fetch frequency.
I'm playing constant tone of 440HZ using Online Tone Generator
I'm getting following output on the console:
439.9840393066406 440.38458251953125 439.7295227050781 439.8203430175781 441.4441223144531 439.86761474609375 439.6636962890625 440.0050354003906 440.33563232421875 439.76751708984375 439.783447265625 440.5208740234375 439.9042053222656 439.4401550292969 440.30364990234375 440.1394348144531 439.8302001953125 439.8034973144531 440.6266784667969 439.9085693359375 439.7518005371094 440.29833984375 440.1784362792969 439.68890380859375 439.7640075683594 440.32940673828125 439.7660827636719 439.8304138183594 440.0731506347656 440.2150573730469 439.9083251953125 440.139404296875 440.3115539550781 439.6862487792969 439.5714416503906 440.3525085449219 440.2285461425781 439.4862976074219 440.1347351074219 440.0155334472656 439.7291564941406 440.0360107421875 440.4422912597656 439.9488220214844 439.7005615234375 440.00689697265625 440.3395080566406 440.0696716308594 439.83135986328125 440.4776916503906 439.94708251953125 439.6653137207031 440.0530090332031 440.1722412109375 439.7640075683594 439.76470947265625 440.46136474609375 439.9795837402344 439.6659240722656 440.28472900390625 440.18646240234375 439.7535705566406 439.69677734375 440.0879821777344 439.6529235839844 439.5359191894531 440.345458984375 440.1731872558594 439.7319030761719 439.70684814453125 439.95050048828125 439.6074523925781 439.70654296875 440.2434387207031 440.247314453125 439.6749572753906 440.07830810546875 439.9927062988281 439.74713134765625 439.5524597167969 440.1600036621094 439.83251953125 440.11181640625 440.08001708984375 440.29376220703125 439.70159912109375 439.84698486328125 441.3559265136719 439.7513122558594 440.255859375 440.0333251953125 440.4356689453125 439.6879577636719 439.8522644042969 440.4087829589844 439.8197326660156 439.828857421875 440.4480895996094 440.10369873046875 439.4685974121094 439.90777587890625 440.0578308105469 439.86865234375 439.73681640625 440.3212890625 440.132080078125 439.73968505859375 439.8338928222656 440.0824279785156 439.7405700683594 439.611328125 440.2831115722656 440.114990234375 439.9194030761719 440.2281188964844 440.4231872558594 439.6780090332031 439.51788330078125 440.2079772949219 440.201171875 439.6846618652344 440.13836669921875 440.3392028808594 439.7142028808594 439.7164306640625 440.0718994140625 439.81396484375 439.661865234375 440.21075439453125 439.94970703125 439.7055969238281 439.9032287597656 441.0694580078125 439.8079528808594 439.4620361328125 440.09283447265625 439.98638916015625 439.68292236328125 439.8896484375

It is not giving me that much accurate frequency values as I am getting in TE Tuner application.
Here is an example of both application with the same frequency:
Te Tuner App example video
Test App example video

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

1 participant