Melodeon.net Forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the new melodeon.net forum

Pages: 1 2 [3] 4   Go Down

Author Topic: Electronic tuners  (Read 24132 times)

0 Members and 1 Guest are viewing this topic.

IanD

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1703
  • Too many melodeons...
Re: Electronic tuners
« Reply #40 on: February 21, 2010, 11:31:24 PM »


That was what I tried when I first started working on the idea about 5 years ago. It wasn't very useful, I found. So I started searching on the web and found Stephan Bernsee's page on Pitch Shifting Using The Fourier Transform. I just use the bin frequency calculation part. It appears to work quite well, see the debug output below. The phase change calculation is done on all bins using the change in phase from each FFT run to the next as compared to the expected change for that bin. There's a very clear explanation on Stephan's page. I haven't yet found another algorithm that will give a fast accurate frequency measurement.

Code: [Select]
Input 1KHz:
Bin, Bin freq, Calculated f, Phase change, Bin level
370, 995.910645, 999.997736, 0.068878, 0.230102
371, 998.602295, 999.973269, 0.073584, 0.551781
372, 1001.293945, 999.985533, -3.071415, 2.542450
373, 1003.985596, 999.987880, 0.069438, 2.513233
374, 1006.677246, 1010.749854, -3.071271, 0.465892

Input 440.6Hz:
Bin, Bin freq, Calculated f, Phase change, Bin level
162, 436.047363, 440.533345, -1.671452, 0.026782
163, 438.739014, 440.560611, -1.663091, 0.168153
164, 441.430664, 440.552464, 1.478087, 0.568718
165, 444.122314, 440.549081, -1.662557, 0.452225
166, 446.813965, 451.315157, 1.486924, 0.052688

The window amplitude fitting method worked fine for me in Matlab, but the phase difference method you've described looks like an even better way of solving the problem :-)

Now all you have to do is make it work for two (or more) reeds only a few Hz (or less) apart...

Ian
Logged
Oakwood Model 4 D/G, Castagnari Dony D/G/#, Castagnari Tommy G/C, Baffetti Binci D/G, Hohner Preciosa D/G, Melos Bb/Eb, Lightwave SL5 and Kala California fretless basses

Owen Woods

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3894
  • melodeonmusic.com
    • The website and blog of Owen Woods
Re: Electronic tuners
« Reply #41 on: February 22, 2010, 01:04:21 AM »

I should probably be worried that whilst we have been studying the Fourier Transform and it's applications to Signal Processing I have no idea what you two are talking about :P
Logged
Bergflodt D/G 4 voice, Saltarelle Bouebe D/G, Super Preciosa D/Em, Hohner Impiliput B/C+C#

Latest blog post: In Any Weather

http://melodeonmusic.com/blog

IanD

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1703
  • Too many melodeons...
Re: Electronic tuners
« Reply #42 on: February 22, 2010, 08:57:15 PM »

I should probably be worried that whilst we have been studying the Fourier Transform and it's applications to Signal Processing I have no idea what you two are talking about :P

Don't worry, thread drift is like that :-)

Ian
Logged
Oakwood Model 4 D/G, Castagnari Dony D/G/#, Castagnari Tommy G/C, Baffetti Binci D/G, Hohner Preciosa D/G, Melos Bb/Eb, Lightwave SL5 and Kala California fretless basses

Bill the Farmer

  • Not quite so
  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 497
  • Hohner Club, Liliput...
    • Bill Farmer
Re: Electronic tuners
« Reply #43 on: February 23, 2010, 01:27:21 PM »

I should probably be worried that whilst we have been studying the Fourier Transform and it's applications to Signal Processing I have no idea what you two are talking about :P

Don't worry, thread drift is like that :-)

Ian

No worse than boats, steam railways, and other boys toys we've had on here...
Logged
Bill of Old Radipole Village

Owen Woods

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3894
  • melodeonmusic.com
    • The website and blog of Owen Woods
Re: Electronic tuners
« Reply #44 on: February 23, 2010, 04:26:53 PM »

I should probably be worried that whilst we have been studying the Fourier Transform and it's applications to Signal Processing I have no idea what you two are talking about :P

Don't worry, thread drift is like that :-)

Ian

No worse than boats, steam railways, and other boys toys we've had on here...

See I can do boats and can follow steam, thanks to a few weeks spent volunteering at Talyllyn, but something relevant to my course? Nah! :P
Logged
Bergflodt D/G 4 voice, Saltarelle Bouebe D/G, Super Preciosa D/Em, Hohner Impiliput B/C+C#

Latest blog post: In Any Weather

http://melodeonmusic.com/blog

Bill the Farmer

  • Not quite so
  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 497
  • Hohner Club, Liliput...
    • Bill Farmer
Re: Electronic tuners
« Reply #45 on: February 24, 2010, 06:23:00 PM »

I should probably be worried that whilst we have been studying the Fourier Transform and it's applications to Signal Processing I have no idea what you two are talking about :P

Don't worry, thread drift is like that :-)

Ian

No worse than boats, steam railways, and other boys toys we've had on here...

See I can do boats and can follow steam, thanks to a few weeks spent volunteering at Talyllyn, but something relevant to my course? Nah! :P

I forgot motorbikes, most remiss of me!  ;D
Logged
Bill of Old Radipole Village

Bill the Farmer

  • Not quite so
  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 497
  • Hohner Club, Liliput...
    • Bill Farmer
Re: Electronic tuners
« Reply #46 on: February 26, 2010, 04:13:53 PM »


That was what I tried when I first started working on the idea about 5 years ago. It wasn't very useful, I found. So I started searching on the web and found Stephan Bernsee's page on Pitch Shifting Using The Fourier Transform. I just use the bin frequency calculation part. It appears to work quite well, see the debug output below. The phase change calculation is done on all bins using the change in phase from each FFT run to the next as compared to the expected change for that bin. There's a very clear explanation on Stephan's page. I haven't yet found another algorithm that will give a fast accurate frequency measurement.

Code: [Select]
Input 1KHz:
Bin, Bin freq, Calculated f, Phase change, Bin level
370, 995.910645, 999.997736, 0.068878, 0.230102
371, 998.602295, 999.973269, 0.073584, 0.551781
372, 1001.293945, 999.985533, -3.071415, 2.542450
373, 1003.985596, 999.987880, 0.069438, 2.513233
374, 1006.677246, 1010.749854, -3.071271, 0.465892

Input 440.6Hz:
Bin, Bin freq, Calculated f, Phase change, Bin level
162, 436.047363, 440.533345, -1.671452, 0.026782
163, 438.739014, 440.560611, -1.663091, 0.168153
164, 441.430664, 440.552464, 1.478087, 0.568718
165, 444.122314, 440.549081, -1.662557, 0.452225
166, 446.813965, 451.315157, 1.486924, 0.052688

The window amplitude fitting method worked fine for me in Matlab, but the phase difference method you've described looks like an even better way of solving the problem :-)

Now all you have to do is make it work for two (or more) reeds only a few Hz (or less) apart...

Ian

I think when I was working on this before I didn't really know what I was doing and I didn't have a tool like Matlab. I have been doing some testing with a DPLL and can get very similar results. You have to filter and average the output to get the same level of accuracy, and you need to know where to kick the DPLL off. However it will lock on to a tone and stay locked in the presence of another extremely close tone at the same level. Next up, Chrip-Z transforms.  ;D :Ph

Edit: There's a couple of really useful pages on Interactive Digital Phase Locked Loop Design and Interactive Digital Filter Design on Tony Fisher's pages. However, when I went to send him an email to say how useful they were, I discovered that he died 10 years ago. He appears to have been quite a character.
« Last Edit: February 26, 2010, 05:11:36 PM by Bill Farmer »
Logged
Bill of Old Radipole Village

diatonix

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 622
Re: Electronic tuners
« Reply #47 on: February 26, 2010, 11:21:46 PM »

I cannot but recommend Dirks' accordion tuner. It's very accurate, easy to get used to and a big time saver.
Logged

Andy Simpson

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 938
Re: Electronic tuners
« Reply #48 on: March 05, 2010, 12:12:30 AM »

I've managed to lay my hands on a slightly used Stroboflip and that'll do me for the time being but I'll probably spring for the full version of Dirk's if I ever get a decent computer.
Logged

Bill the Farmer

  • Not quite so
  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 497
  • Hohner Club, Liliput...
    • Bill Farmer
Re: Electronic tuners
« Reply #49 on: June 23, 2010, 04:19:21 PM »

Beta version of my tuner mentioned below released on Google code.

This version shows the spectrum of the current note when zoomed in, so you can see more than one reed. You need to check that the audio input clock is accurate, two out of three laptops I tested were up to 7% out. I have included a facility to adjust for this.
Logged
Bill of Old Radipole Village

Owen Woods

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3894
  • melodeonmusic.com
    • The website and blog of Owen Woods
Re: Electronic tuners
« Reply #50 on: June 24, 2010, 12:19:14 AM »

How reliable is it? I may try playing around with it tomorrow.
Logged
Bergflodt D/G 4 voice, Saltarelle Bouebe D/G, Super Preciosa D/Em, Hohner Impiliput B/C+C#

Latest blog post: In Any Weather

http://melodeonmusic.com/blog

Bill the Farmer

  • Not quite so
  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 497
  • Hohner Club, Liliput...
    • Bill Farmer
Re: Electronic tuners
« Reply #51 on: June 24, 2010, 01:23:29 PM »

I found another bug already, but it only affects saving the correction value   :-[
Logged
Bill of Old Radipole Village

diatonix

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 622
Re: Electronic tuners
« Reply #52 on: June 24, 2010, 08:08:38 PM »

Good tuning devices are certainly helpful tools, but they do not compensate for lack of skill and experience. It takes many years to become a good tuner, with or without electronic device. An experienced tuner should be able to tune any instrument, chromatic or diatonic, by ear, starting from the one note he or she fetches from a chosen device. In the old days we even used the telephone and its dialling tone (a1=440Hz)!
Logged

Bill the Farmer

  • Not quite so
  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 497
  • Hohner Club, Liliput...
    • Bill Farmer
Re: Electronic tuners
« Reply #53 on: June 25, 2010, 12:44:21 PM »

I once tuned someone's autoharp using that method. Haven't seen one of those for a long time.

I just tested the dial tone, looks like it's 450Hz these days. Back in the day it would have come from a rotary machine.
« Last Edit: June 25, 2010, 12:49:51 PM by Bill the Farmer »
Logged
Bill of Old Radipole Village

Broadland Boy

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1243
  • Awful noises from Pokerwork, HA114G, BbEb Liliputs
Re: Electronic tuners
« Reply #54 on: June 25, 2010, 07:29:42 PM »

I found another bug already, but it only affects saving the correction value   :-[

I've installed it and tried it out Bill and it seems to work well on my laptop with a relatively cheap mic !

There are some clever people 'of this Parish'   :|glug

Richard

Logged
Richard A
Venit ventus contrarius ventus egrediente,
Omnes prope quid ventum est circa

cboody

  • Member
  • *
  • Offline Offline
  • Posts: 26
Re: Electronic tuners
« Reply #55 on: June 27, 2010, 05:34:03 AM »

happy to beta for you on the Mac when you get a round to it.  Lots of years of doing that sort of thing.  PM if I can be of help.
Logged

Bill the Farmer

  • Not quite so
  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 497
  • Hohner Club, Liliput...
    • Bill Farmer
Re: Electronic tuners
« Reply #56 on: June 27, 2010, 10:54:28 AM »

happy to beta for you on the Mac when you get a round to it.  Lots of years of doing that sort of thing.  PM if I can be of help.

My not-a-mac is broke at the moment, when I get it working I shall start on the mac version.
Logged
Bill of Old Radipole Village

Bill the Farmer

  • Not quite so
  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 497
  • Hohner Club, Liliput...
    • Bill Farmer
Re: Electronic tuners
« Reply #57 on: August 10, 2010, 09:52:40 AM »

Having had a good long time using your tuner, for which I am truly grateful, I have a few user observations which, should you go to a gamma version, you might consider.

On the laptop, the screen is a wee bit on the compact side
Being able to freeze or latch the most recent frequency info while you jot it down - or feed it into Excel in my case
(the next significant noise it hears alters the display, OK if you don't have kids in the house I guess !)
As a consequence of using Excel to record the current state of play, being able to use Ctrl+c on the data to Ctrl+v into the spreadsheet, notepad or other means of recording the data would be very useful.
The spectrum display when zoomed was too magnified for any of my way off tune bass reeds to be seen and when unzoomed, the reverse  ;) ...
Richard

I've put an updated version up, which addresses some of Broadland Boy's comments.

  • The display locks when clicked
  • Ctrl-C copies the displayed values to the clipboard

The zoomed in spectrum shows about +-50cents around the current note. If it's out more than that it should jump to the next higher or lower note. At low frequencies there are only a few sample points on the spectrum display, so it's not so clear.

Bill
Logged
Bill of Old Radipole Village

Broadland Boy

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1243
  • Awful noises from Pokerwork, HA114G, BbEb Liliputs
Re: Electronic tuners
« Reply #58 on: August 10, 2010, 12:20:33 PM »

What a Star !!

Will download and try out the enhancements  (:)

Thank you Bill

Richard
Logged
Richard A
Venit ventus contrarius ventus egrediente,
Omnes prope quid ventum est circa

Bill the Farmer

  • Not quite so
  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 497
  • Hohner Club, Liliput...
    • Bill Farmer
Re: Electronic tuners
« Reply #59 on: October 01, 2010, 09:52:25 AM »

I have released beta mac version. This has not yet been tested on a real Mac. I'm waiting for my daughter to get back from across the pond.
Logged
Bill of Old Radipole Village
Pages: 1 2 [3] 4   Go Up
 


Melodeon.net - (c) Theo Gibb; Clive Williams 2010. The access and use of this website and forum featuring these terms and conditions constitutes your acceptance of these terms and conditions.
SimplePortal 2.3.5 © 2008-2012, SimplePortal