Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: Voice Authentication with FFT

  1. #1
    Junior Member
    Join Date
    Feb 2021
    Posts
    13

    Voice Authentication with FFT

    Hello dear Forum members,

    i have an idea for an algorithm i want to realize at an uni-project. And i would like to know what you guys think about it before starting.

    I've seen a thread regarding FFT support for teensy 4.0 in this forum. Paul Stoffregen posted a segment of code there which should give the FFT spectrum of an audio signal which is beeing sent through PIN 2 of Teensy 4.0 or Teensy 4.1.
    So that made me think ... could there be a way to connect a microphone to PIN 2 and record some audio as a fourier transformation and kind of save it as a sample ... and then make another recording and start to compare the discrete frequencies with the first recording?

    With an algorithm like that you should be able to do some kind of voice authentification and i would like to give that project a try.

    does someone know the FFT code origin from Examples>Audio>FFT? I would need to sweep through the spectrum and get a matrix of discrete values for specific discrete frequencies, rather than a graphical result for a spectrum analyser.

    Furthermore: has someone an idea on how to evaluate the data recorded in recording 1 and recording 2?

    Any help or suggestions about this would be highly appreciated


    with kind regards,
    Mala

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    8,219
    Hi,

    not sure where the "Pin2" comes from. Anyway, It's not important.
    I believe that it is possible to distinguish different voices. At least maybe women's and men's voices?


    I would take a teensy 4.1 with an audio board, along with the microphone.

    You should look at the audio library and examples for that though.
    You don't need to touch or change the code for the FFT. If you are interested, you can find it here and here.

    Interesting project!

    I'd try it without a microcontroller at first. Maybe use audacity and matlab?

  3. #3
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    8,219
    The CMSIS math library (comes with teensyduino) might be useful, too.

  4. #4
    Junior Member
    Join Date
    Feb 2021
    Posts
    13
    Quote Originally Posted by Frank B View Post
    Hi,

    I believe that it is possible to distinguish different voices. At least maybe women's and men's voices?

    Guten Morgen Frank,

    i thought of using this device for example for my phone as an authentification.
    With a FFT of my voice I should get a pretty unique fundamental with a overtone series. I think it could work pretty well.

    Audacity and Matlab might me a good start indeed! Maybe I'll sample a lot of me talking with an old MIC and analyse how the spectrum is behaving when I'm talking. Then I would just need to write some kind of sorting algorithm that compares the original sample with the sample that "wants to be authentificated" and the device would be finished

    Found some interesting projects on research gate aswell:
    if some of you are interested google for 'Voice Authentification site:researchgate.net' there are lots of good approaches.


    One thing still is bothering me: what if someone has an audio record of my voice? how could i avoid that person hijacking my phone when they play that record with another device? Do you guys know if a microphone can sense the ankle a person is standing in front of the MIC? That way i could at least ensure that a playback without a real person talking wouldn't be mistaken as my real voice.

    Thank you all!

  5. #5
    Senior Member
    Join Date
    Jul 2020
    Posts
    897
    Bear in mind voice recognition is not a simple problem. For instance have a look at this paper as an example of the techniques
    and an idea of the complexity: https://arxiv.org/ftp/arxiv/papers/1003/1003.4083.pdf

    So I guess I'm saying don't expect miracles with simple techniques... Try and find existing libraries too...

  6. #6
    Senior Member
    Join Date
    Apr 2020
    Location
    DFW area in Texas
    Posts
    229
    Quote Originally Posted by mala96 View Post
    One thing still is bothering me: what if someone has an audio record of my voice? how could i avoid that person hijacking my phone when they play that record with another device? Do you guys know if a microphone can sense the ankle a person is standing in front of the MIC? That way i could at least ensure that a playback without a real person talking wouldn't be mistaken as my real voice.
    As one possibility for avoiding the problem of distinguishing between "live or Memorex" (showing my age), you could have the Teensy randomly generate & display a combination of a few words from a much larger list to be spoken whenever you need to authenticate. You could "train" the system in advance with your voice for each word & require that the potential speaker speak these words in the given order, then check for a quality match. Someone else would not only have to know your entire list, but to also have a recording of you saying each & every one of them in order to completely fool the system. Just a thought . . .

    Mark J Culross
    KD5RXT

    P.S. Another thought with a simple example of making it even more foolproof: if you used colors as a simple list of words, when training the system, you could intentionally speak a color that is different from the one that is displayed, making it even harder for someone else to pass your test. You just have to remember the mapping from displayed color to spoken color. MJC

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •