# Patent

## Title
Latency enhanced note recognition method

## Abstract

The present invention relates to the field of audio recognition, in particular to computer implemented note recognition methods. Furthermore, the present invention relates to improving latency of such audio recognition methods. One of the embodiments of the invention described herein is a method for note recognition of an audio source. The method includes: dividing an audio input into a plurality of frames, each frame having a pre-determined length, conducting a frequency analysis of at least a set of the plurality of frames, based on the frequency analysis, determining if a frame is a transient frame with a frequency change between the beginning and end of the frame, comparing the frequency analysis of each said transient frame to the frequency analysis of an immediately preceding frame and, based on said comparison, determining at least one probable pitch present at the end of each transient frame, and for each transient frame, outputting pitch data indicative of the probable pitch present at the end of the transient frame.

## Background
FIELD OF INVENTION
The present invention relates to the field of audio recognition, in particular to computer implemented note recognition methods. Furthermore, the present invention relates to improving latency of such audio recognition methods.
BACKGROUND OF INVENTION
Audio recognition software has been around for many years. However, most audio recognition software, particularly used for recognizing music and in particular notes, is used on recorded audio files. Since the audio sources are not live, it is possible for old audio recognition software to determine notes through an iterative and time consuming/processor consuming process in order to make accurate determinations.
Current technology requires an audio recognition method for determining notes in an audio file in real time. For old audio recognition software which is not designed for real-time use several problems present themselves, particularly regarding latency. For example, known audio recognition software has trouble in determining what a new note is in a sequence of notes instantaneously. Therefore, some software delay in outputting what the new note is until it is accurately determined.
However, the human ear and brain are quite sensitive and can very quickly determine that a new note is present almost instantaneously, though they may not know exactly what that new note is at the same instance. When someone knows that a new note is present and recognition software they are using does not at the same time register a change, the discrepancy can be easily noticed and cause discomfort for a user.
SUMMARY OF THE INVENTION
One of the embodiments of the invention described herein is a method for note recognition of an audio source. The method comprises the steps of: dividing an audio input into a plurality of frames, each frame having a pre-determined length, conducting a frequency analysis of at least a set of the plurality of frames, based on the frequency analysis, determining if a frame is a transient frame with a frequency change between the beginning and end of the frame, comparing the frequency analysis of each said transient frame to the frequency analysis of an immediately preceding frame and, based on said comparison, determining at least one probable pitch present at the end of each transient frame, and for each transient frame, outputting pitch data indicative of the probable pitch present at the end of the transient frame.
Several of the embodiments described herein can be carried out in real time. An advantage to methods described herein is for latency reduction in, for example, real time note recognition in a computing device. By making a best guess of a note in each of a plurality of frames and outputting that best guess, for example regardless of the confidence in the guess, perceived latency can be noticeably increased. For example, instead of waiting to output a pitch present in an analyzed frame of an audio source until there is high confidence in the correctness of the detected pitch and instead outputting a best guess immediately, a user can correctly perceive the change in pitch with decreased lag in the analysis.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 shows an example time domain signal plot of an audio input.
FIGS. 2A-2C show frequency graphs of samples 12-14 respectively from the plot of FIG. 1.
FIG. 3 shows an example method for note recognition.



DETAILED DESCRIPTION OF EXEMPLARY EMBODIMENTS
FIG. 1 shows an example plot 10 of an audio input 11. In the example, the input has been broken into four frames, 12-15.
A frame is simply a finite portion of an audio input. It is preferred that each frame in a method has the same length. For example, if an audio input is from a digital-audio converter having e.g. 44100 samples per second, a frame length can be a predetermined number of said samples, e.g. 512 samples. According to certain examples a frame is between 5-20 milliseconds, preferably 10-15 milliseconds in length. According to certain examples, the length of a frame is 12 milliseconds.
For the purposes of the present description, a frame of an audio input which has additional frequency components compared to the previous frame, such as frames 13 and 16, is considered a transient frame. Additionally, as will be discussed below, other types of frames can be treated as transient frames, even if they do not contain more than one main frequency.
FIG. 3 shows an example method of note recognition 30. First an audio input is received 31. The audio input can be in many forms. For example, the audio input can be a recording and can be in the form of an audio file stored on a computer readable medium. Additionally, the audio input can be a live and/or streaming audio input from an audio source. Examples of audio sources can be a streaming internet page, microphone or other input from a stringed instrument, or an electric keyboard. The audio input can also be a signal from a digital-audio converter.
The audio input is then divided 32 into a series of frames, for example as shown in FIG. 1. For example, if the audio input is pre-stored then it can be broken into a plurality of even frames. For real-time processing, a predetermined frame length can be set and as enough of the audio input is received to form the next frame in a series of frames, then the frame is formed and the system can analyses it. Additionally, there can be buffering between the reception of the audio input, the dividing into frames and the processing of the frames as discussed below.
According to certain examples, for each frame it is determined what pitch is present during the frame. This can be done in a plurality of ways. For example, the frequency during the frame can be averaged and/or subjected to one or more filters which determine the pitch present during that frame. Additionally, a frequency graph from the frame can be created and analyses to determine a pitch present during the frame. Still yet, the frame, or a frequency graph for the frame, can be compared to pre-stored examples/charts to determine based on correlation what the pitch present is during the frame. Likewise, combinations of the above are possible.
Additionally, a pitch determined herein can be a perceived pitch of a listener to the audio input. The pitch, or perceived pitch, of a frame typically includes a set of frequencies. For example, if an A-note is recorded from a guitar and used as an audio input, a frequency analysis of a frame while the A-note is being played can contain several frequency components such as 110 Hz, 220 Hz, 440 Hz, 660 Hz and 880 Hz. Of these components, 110 Hz can be considered the fundamental frequency which corresponds to the perceived pitch of A. Therefore, a frequency analysis of a frame can include a determination of one or more fundamental frequencies, which correspond to one or more pitches present in the frame. Based on this frequency analysis, pitch data which is indicative of the pitch or pitches in the frame can be generated and output.
Furthermore, in examples where a pitch is determined for each frame, the determined pitch for one frame can be compared to the determined pitches of the preceding pitches to determine a consistent pitch being present over a plurality of frames.
However, it is transient frames which present the most problems. Therefore, according to certain examples, it is determined for each frame if the frame is transient or not 33. Such a determination can occur in several ways. For example, if a new frame is compared to an earlier frame, e.g. the immediately preceding frame, and the two frames are the same or similar, then it can be determined that the new frame is not a transient frame.
Additionally, the frequency graph/frequency analysis of a new frame can be compared to the frequency graph/frequency analysis of an earlier frame. In particular high frequency peaks between the two frames can be compared. If the high frequency peaks in two frames occurs in approximately the same range(s) then it can be determined that the pitches present in both frames are the same and that the new frame is not a transient frame. However, if high frequency peaks in the new frame differ from those of the previous one by more than a predetermined amount, then it can be determined that the new frame is a transient frame. Therefore it is likely the pitch present at the end of the transient frame is a different pitch than at the beginning of the transient frame.
As described herein as well, silence, or the lack of at least one defined perceived pitch, for example, can be considered a pitch. Particularly, when determining transient frames, a frame which has no note, pitch, perceived pitch and/or has silence at only one end of the frame, or only during a middle portion of the frame, can be considered transient.
As described herein, a note can be an specific pitch, e.g. a specific frequency, or it can be a base note, e.g. C, D, E, F, G, A, B, C which is independent of an octave. For example, the note can also be one of a sup-set of all notes or a general note which is representative of a group of notes, as discussed above. A further example is where an audio source is a stringed instrument, e.g. a midi guitar, regular guitar or electric violin, and the note is representative of one of the frets, e.g. one of the nine frets of a standard guitar, and/or one of the five strings.
Additionally, the note can be any of the notes as described in U.S. Pat. No. 8,802,955 “Chord based method of assigning musical pitches to keys”, WO/2015/055895 “Selective pitch emulator for electrical stringed instruments” or WO 2015/140412 “Method for adjusting the complexity of a chord in an electronic device”, all three of which publications are incorporated by reference in their entirety herein. Furthermore, the notes as described herein can be input to any of the methods and systems as described in the publications incorporated by reference in the present description.
Once a transient frame has been determined, the probable pitch at the end of the transient frame is guessed 34 and output 35. FIGS. 2A-2C show frequency charts of the frames 12-14 including that of transient frame 13 and the immediately preceding frame 12 and following frame 14. As can be seen in the figure, frame 12 has an detected pitch f(12) which is indicative of a first pitch. Similarly, frame 14 has an detected pitch f(14) which is indicative of a second pitch. However, the detected pitch of frame 13 would not be an accurate representation of the pitch played at either the beginning nor the end of the frame as it is a combination of two pitches.
In the middle of frame 13 a new pitch is played which is fully registered by frame 14 but also for a portion of frame 13. In the current example, a detected pitch of frame 13 would be lower than what would be indicative of the actual pitch being present at the end of the frame due to the presence for a portion of the time of f(12) which is lower than f(14). Therefore, when a transient frame has been detected, the system can make it's best guess as to what the new pitch is and output that best guess.
The system can determine the best guess in several ways. According to one example, the detected pitch of the transient frame can be compared to that of the detected pitch of the previous frame. If the detected pitch of the previous frame was lower than the detected pitch of the transient frame then an assumption can be made that the detected pitch of the transient frame is lower than the detected pitch indicative of the new pitch being played. Therefore, if the detected pitch of the transient frame is between a base pitch C and a base pitch D, the guess can be made that it is more likely D than C and the base pitch D can be output.
Similarly, if a frequency chart is compared between the transient frame and the previous frame then the changes in high frequency peaks can be determined and a similar analysis made as discussed above. However, it is useful that a guess is made which is a different from the previous frame pitch. This is so that a user who self-identifies a change in pitch will also concurrently realize a change in pitch from the pitch recognition software and thereby reduce latency. The fact that the guess may be wrong is generally less important than the fact that a change has been made in the first place.
Once a guess has been made and output and the following frame 14 is received, then a more accurate pitch determination can be made on the non-transient frame 14. The accuracy of the guess made in step 34 can be checked in step 36 by comparing it to the pitch determined for the following frame 14. If the pitch determined for the following frame is the same as the guess then it can be determined that the guess was accurate and nothing needs to be changed. If the guess is determined to be wrong, then a new pitch can be output 37 in accordance with the determination of the new pitch in the following, non-transient frame, e.g. 14.
In most scenarios, if the guess is slightly wrong then it is only wrong for about one frame length. While one frame length is long enough for a user to determine that something has changed, it is typically not long enough for a user to determine what the exact pitch is, nor that a “wrong” pitch was output for a single, or even a few, frame length(s).
According to a certain example, there is a method for note and/or pitch recognition of an audio source including dividing an audio input into a plurality of frames, determining if a frame is a transient frame and conducting a frequency analysis of each transient frame. Additionally, a frequency analysis of each frame immediately preceding each transient frame can be made and to determine a probable pitch present at the end of each transient frame.
The methods described herein can be carried out in real time. For example, the time from the input of a frame to the output of the probable pitch can be less than or equal to one frame. For example, if a frame is 512 samples, and there are 44100 samples per second in the audio input, then the length of the frame can also be expressed as between 11-12 milliseconds, e.g. 11.6 milliseconds.
Methods can further include conducting a frequency analysis of at least one non-transient frame following a transient frame, checking if the pitch of said following frame is the same as the output probable pitch and if not, outputting the pitch of the following frame.
Additionally, for each frame, a probability can be determined that the determined pitch is accurate. If the probability is below a pre-determined threshold, then the frame can be considered to be a transient frame.
According to certain examples, there is a method for note recognition of an audio source, comprising the step conducting a frequency analysis of at least a set of a plurality of frames. The set can be all of the frames of an audio input or a subsection. Based on the frequency analysis, determining if a frame is a transient frame can be carried out. The determination can be based on if there is a frequency change between the beginning and end of the frame, or a likelihood thereof.
The frequency analysis of each transient frame can be compared to the frequency analysis of at least one immediately preceding frame and. Based on said comparison, it can be determined at least one probable pitch present at the end of each transient frame.
For one or more frame, and/or for each or at least one transient frame, outputting pitch data indicative of the probable pitch present at the end of the frame.
The frequency analysis of each frame can includes determining an estimated pitch determination for the frame and a probability that the determined pitch is correct. Pitch data indicative of the probably pitch can be based on a determined fundamental frequency component of the frequency analysis for each frame which correlates to a specific perceived pitch or set of perceived pitches, e.g. a chord or an un-correlated set of pitches.
Determined pitch data can includes at least one of the following notes; C, C#, D, D#, E, F, F#, G, G#, A, A#, and B with or without an octave indicator. For example, pitch data can be one of the 88 distinct pitches of a standard electric keyboard.
Furthermore, there can be a non-transitory computer readable medium having stored thereon a set of computer readable instructions for causing a processor of a computing device to carry out the methods and steps described above.
It is to be understood that the embodiments of the invention disclosed are not limited to the particular structures, process steps, or materials disclosed herein, but are extended to equivalents thereof as would be recognized by those ordinarily skilled in the relevant arts. It should also be understood that terminology employed herein is used for the purpose of describing particular embodiments only and is not intended to be limiting.
Reference throughout this specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, appearances of the phrases “in one embodiment” or “in an embodiment” in various places throughout this specification are not necessarily all referring to the same embodiment.
As used herein, a plurality of items, structural elements, compositional elements, and/or materials may be presented in a common list for convenience. However, these lists should be construed as though each member of the list is individually identified as a separate and unique member. Thus, no individual member of such list should be construed as a de facto equivalent of any other member of the same list solely based on their presentation in a common group without indications to the contrary. In addition, various embodiments and example of the present invention may be referred to herein along with alternatives for the various components thereof. It is understood that such embodiments, examples, and alternatives are not to be construed as de facto equivalents of one another, but are to be considered as separate and autonomous representations of the present invention.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided, such as examples of lengths, widths, shapes, etc., to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention can be practiced without one or more of the specific details, or with other methods, components, materials, etc. In other instances, well-known structures, materials, or operations are not shown or described in detail to avoid obscuring aspects of the invention.
While the forgoing examples are illustrative of the principles of the present invention in one or more particular applications, it will be apparent to those of ordinary skill in the art that numerous modifications in form, usage and details of implementation can be made without the exercise of inventive faculty, and without departing from the principles and concepts of the invention. Accordingly, it is not intended that the invention be limited, except as by the claims set forth below.

## Claims

1. A method for note recognition of an audio source, said method comprising the steps of:
dividing an audio input into a plurality of frames, each frame having a pre-determined length,
conducting a frequency analysis of at least a set of the plurality of frames,
based on the frequency analysis, determining if a frame is a transient frame with a frequency change between the beginning and end of the frame,
comparing the frequency analysis of each said transient frame to the frequency analysis of an immediately preceding frame and, based on said comparison, determining at least one probable pitch present at the end of each transient frame, and
for each transient frame, outputting pitch data indicative of the probable pitch present at the end of the transient frame.

2. The method according to claim 1, wherein the method is carried out in real time.

3. The method according to claim 2, wherein the time from the input of said frame to the output of the probable pitch is less than one frame.

4. The method according to claim 1, further comprising conducting a frequency analysis of at least one non-transient frame following a transient frame, based on the frequency analysis determining a pitch of the frame, checking if the determined pitch of said following frame is the same as the output probable pitch and if not, outputting pitch data of the following frame.

5. The method according to claim 1, wherein the frequency analysis of each frame includes determining an estimated pitch determination for the frame and a probability that the determined pitch is correct.

6. The method according to claim 5, further comprising, if the probability 1s below a pre-determined threshold, considering the frame to be a transient frame.

7. The method according to claim 1, wherein the pitch data indicative of the probably pitch is based on a determined fundamental frequency component of the frequency analysis for each frame which correlates to a specific perceived pitch.

8. The method according to claim 1, wherein each determined pitch data includes at least one of the following notes; C, C#, D, D#, E, F, F#, G, G#, A, A#, and B with or without an octave indicator.

9. The method according to claim 1, wherein the length of each frame is 5-20 milliseconds.

10. The method according to claim 1, wherein said comparing step includes determining which high frequency peaks have changed between the frames and based at least on the changed high frequency peaks, determining the probable pitch present at the end of the transient frame.

11. The method according to claim 1, wherein the audio input is from a microphone of a stringed instrument.

12. A non-transitory computer readable medium having stored thereon a set of computer readable instructions for causing a processor of a computing device to carry out the steps of:
dividing an audio input into a plurality of frames, each frame having a pre-determined length,
conducting a frequency analysis of at least a set of the plurality of frames,
based on the frequency analysis, determining if a frame is a transient frame with a frequency change between the beginning and end of the frame,
comparing the frequency analysis of each said transient frame to the frequency analysis of an immediately preceding frame and, based on said comparison, determining at least one probable pitch present at the end of each transient frame, and
for each transient frame, outputting pitch data indicative of the probable pitch present at the end of the transient frame.

13. The non-transitory computer readable medium according to claim 12, wherein the time from the input of said frame to the output of the probable pitch is less than one frame.

14. The non-transitory computer readable medium according to claim 12, further comprising conducting a frequency analysis of at least one non-transient frame following a transient frame, based on the frequency analysis determining a pitch of the frame, checking if the determined pitch of said following frame is the same as the output probable pitch and if not, outputting pitch data of the following frame.

15. The non-transitory computer readable medium according to claim 12, wherein the frequency analysis of each frame includes determining an estimated pitch determination for the frame and a probability that the determined pitch is correct.

16. The non-transitory computer readable medium according to claim 12, wherein said comparing step includes determining which high frequency peaks have changed between the frames and based at least on the changed high frequency peaks, determining the probable pitch present at the end of the transient frame.