A method and device for detecting the starting point of tonal music notes and decoding the notes
Through spectrum leakage feature extraction and segmented harmonic model, combined with short-time Fourier transform, the problem of insufficient accuracy and efficiency of deep learning algorithm in tonal music note starting point detection is solved, and high-precision and efficient note starting point detection is achieved. Onset detection and decoding for non-Western music.
Patent Information
- Application Number
- CN202211110245.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-13
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing deep learning algorithms ignore the characteristics of music signals in tonal music note starting point detection, resulting in insufficient detection accuracy and efficiency, and poor universality, making it difficult to apply to non-Western music.
By drawing the endpoint detection function curve for spectrum leakage feature extraction, combined with the segmented harmonic model and short-time Fourier transform, the note starting point and pitch frequency are extracted, and the 12-well tempered note table is used for decoding to realize note starting time detection and decoding.
It improves the precision and accuracy of note starting point detection, makes the model more universal, reduces the consumption of computing resources, and achieves efficient note decoding.
Smart Images

Figure CN115472143B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of music information retrieval, to the field of signal analysis and processing technology, and in particular to a method and device for detecting the starting point of a tonal music note and decoding the note. Background Art
[0002] Music is everywhere in our lives and is a very important part of human history. In recent years, with the rapid development of Internet technology, music has been more widely spread, and audio compression technology represented by MP3 has begun to be widely used, which has almost eliminated traditional music media such as vinyl records and tapes, and replaced them with digital music that is transmitted, downloaded and listened to on the Internet. Faced with a massive amount of digital music, how to effectively extract, retrieve and organize music information has received widespread attention from the academic and information communities, giving rise to the subject of Music Information Retrieval (MIR). [1] Compared to atonal music, tonal music has a central tone, around which the chord composition and melody progression revolve. [2] This type of music consists of a series of beats with a strong sense of direction. One of the most basic tasks in music analysis is note starting point detection. [3][4] .
[0003] Obviously, onset detection is the premise of note decoding, and it is also a basic topic for solving various other MIR problems. For example, beat points are generally accompanied by the onset of notes. The information of the onset of notes can be used for further research on rhythm analysis and beat tracking; for melody search topics, with the information of the onset of notes, the frame overlap rate can be reduced and the retrieval speed can be improved; for fundamental frequency estimation and pitch recognition, the problem is also based on the correct detection of the onset of notes; in addition, onset detection can also help improve automatic music transcription (AMT). Generally speaking, the core problem that needs to be solved in the onset detection method of note onset detection is the design of onset detection function (ODF). The audio signal can be converted into an onset detection function, which should have a fairly low value (close to zero) most of the time, but have a clear peak at the onset time.
[0004] With the popularity and development of deep learning, more and more onset detection research starts from learning networks to optimize and improve related algorithms. The typical onset detection process based on deep learning includes: framing, feature extraction, network structure generated based on ODF, and peak selection. [5-7] Jan Schlüter et al.[8] A CNN (Convolutional Neural Network) network is used to learn the ODF from the input feature vector to detect the onset. Erik Marchi et al. [9] The audio is transformed by wavelet and short-time Fourier transform respectively and then input into RNN (recurrent neural network) network and LSTM (long short-term memory) network for note starting point detection. Peter Steiner et al.
[10] Introducing Echo State Networks (ESNs)
[11] To study ODF, and based on it, a new stacked ESN algorithm was proposed.
[0005] Research on deep learning networks usually ignores the characteristics of the music signal itself. Since the network consists of a large number of layers, it is difficult to determine the role of these layers individually, which hinders the universalization of starting point detection for other types of music. For example, ethnic music has very special morphological characteristics. The audio morphological feature recognition and retrieval method based on the harmony and structure system of Western music, which is widely used in the field of world music computing, is not applicable to ethnic music in my country.
[0006] At the same time, in the algorithm flow of deep learning, both feature extraction and ODF generation are complex. Specifically, feature extraction involves short-time Fourier transform, filter bank, spectral flux extraction, feature vector construction, etc. What is more complicated than this is that to obtain the best ODF, it is necessary to go through a series of learning networks such as sample labeling and training, weight update operations based on error propagation, and pattern testing to explore the relationship between feature vectors and starting time points. Although these operations may produce higher detection accuracy, they are not efficient enough and consume a lot of computing resources.
[0007] References
[0008] [1]Fingerhut M.Music Information Retrieval,or howto search for(andmaybe find)music and do away with incipits[J].International Association ofMusic Libraries International Association ofSound&Audiovisual ArchivesCongress,2004.
[0009] [2] Chen Xiaobing. Construction of Schoenberg's Metatonal Music Concept[J]. Chinese Music, 2006(1):2.
[0010] [3]Schreiber H,Weis C,Muller M.Local Key Estimation In ClassicalMusic Recordings:A Cross-Version Study on Schubert's Winterreise[C] / / ICASSP2020-2020IEEE International Conference on Acoustics,Speech andSignalProcessing(ICASSP).IEEE,2020.
[0011] [4]Dixon,Simon.Evaluation ofthe Audio Beat Tracking System Beat Root[J].Journal ofNew Music Research,2007,36(1):39-50.
[0012] [5]Grosche P,MüM,ller.Extracting Predominant Local Pulse InformationFrom Music Recordings[J].IEEE Transactions on Audio,Speech,andLanguageProcessing,2011.
[0013] [6]Percival G,Tzanetakis G.Streamlined Tempo Estimation Based onAutocorrelation and Cross-correlation With Pulses[J].IEEE / ACM Transa ctionsonAudio Speech&Language Processing,2014,22(12):1765-1776.
[0014] [7]Steiner P,Jalalvand A,Stone S,et al.Feature Engineering andStacked Echo State Networks for Musical Onset Detection[C] / / ICPR 2020.2021.
[0015] [8]Schlüter J,S.Improved musical onset detection withConvolutiona lNeural Networks[C] / / IEEE International Conference on Acoustics,Spee ch andSignal Processing.IEEE,2014:6979-6983.
[0016] [9]Marchi E,Ferroni G,Eyben F,et al.Audio Onset Detection:A WaveletPacket Based Approach with Recurrent Neural Networks[C] / / 2014InternationalJoint Conference onNeural Networks(IJCNN).IEEE,2014.
[0017]
[10] Steiner P,Jalalvand A,Stone S,et al.Feature Engineering andStacked Echo State Networks for Musical Onset Detection[C] / / ICPR 2020.2021.
[0018]
[11] SteinerP,Stone S,Birkholz P.Note Onset Detection using EchoSt ateNetworks[C] / / Elektronische Sprachsignalverarbeitung(ESSV)2020.2020.
[0019]
[12] Herremans D,Chew E.MorpheuS:generating structured music withconstrained patterns and tension[J].IEEE Transactions on Affective Computing,2017:1-1. Summary of the Invention
[0020] The present invention provides a tonal music note starting point detection and note decoding device, which realizes the note starting time detection and note decoding; the present invention explores the intrinsic relationship between the starting time point and the tonal rhythm based on the characteristics of the audio signal itself to obtain the ODF curve, so that the precision and accuracy are improved, and the model is more universal, as described below:
[0021] A method for detecting the starting point of a tonal music note and decoding the note, the method comprising:
[0022] Draw η(m) as the endpoint detection function curve, and detect the extreme points of the curve as the starting time positions of the musical notes of each tonality;
[0023] In the middle of the starting time of adjacent notes Search out its corresponding FFT spectrum The peak spectrum number k p , and calculate the corresponding pitch frequency k p Δf;
[0024] Compare the pitch frequency with the reference frequency of each note in the 12-tone equal temperament note-pitch table, and find the note with the smallest frequency difference as the note decoding result of the current period;
[0025] The method models tonal music as a piecewise harmonic model, which is extended to actual tonal music and expressed as:
[0026]
[0027] Among them, {A k ,f k ,θ k},k=1,...,K1 and They represent the amplitude, frequency and initial phase of the previous beat and the next beat respectively.
[0028] where the time period is at least twice the FFT size, N T >2N,N T is the number of samples in the beat period, and N is the FFT size.
[0029] Furthermore, the drawing of η(m) as an endpoint detection function curve is specifically:
[0030] The frequency range corresponds to the FFT index range as follows:
[0031] k∈[k min ,k max ],k min =f min / Δf,k max =fmax / Δf
[0032] When the observation window moves to the position of mΔt, it corresponds to the windowed FFT spectrum X(m,k) extracted from the STFT time-frequency distribution, where the peak is expressed as:
[0033]
[0034] The indicator is defined as:
[0035]
[0036] Where k is the frequency index; Δf is the frequency resolution; f min is the lower frequency limit; f max is the upper frequency limit; Δt=Δd / f s ;"card(·)" indicates Operator for statistical counting, α refers to the specified threshold ratio;
[0037] The pitch frequency is compared with the reference frequency of each note in the 12-tone equal temperament note-pitch table, and the note with the smallest frequency difference is found as the note decoding result of the current period. Specifically,
[0038] Assume that the start time t of the mth note has been detected m and the start time t of the (m+1)th note m+1 , the intermediate time (t m +t m+1 ) / 2 is regarded as a reliable point for music decoding, corresponding to the STFT index:
[0039]
[0040] Wherein, Δd is the step size of the STFT; “[·]” represents the integer rounding operator.
[0041] Where "[·]" represents the integer rounding operator, the windowed FFT spectrum is taken as a peak, and the peak spectrum index is found as:
[0042]
[0043] The melody frequency of this main spectrum is estimated to be:
[0044]
[0045] Finally, we determine which piano key was pressed by looking up the piano pitch table to find the closest frequency.
[0046] A device for detecting the starting point of a tonal music note and decoding the note, the device comprising: a processor and a memory, the memory storing program instructions, the processor calling the program instructions stored in the memory to enable the device to execute any of the method steps described.
[0047] The beneficial effects of the technical solution provided by the present invention are:
[0048] 1. The present invention realizes note decoding and note start time detection, which provides a direction for the research breakthrough of music information retrieval, that is, no longer obsessed with simply improving deep learning algorithms, but turning to the unique physical characteristics of music itself, such as time domain, frequency domain and phase, and combining the two to achieve more breakthroughs;
[0049] 2. The present invention takes note starting point detection as one of the basic research directions of music information retrieval, laying the foundation for advanced tasks such as rhythm analysis, beat tracking, fundamental frequency estimation, and pitch recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a flow chart of a device for detecting the starting point of a tonal music note and decoding the note, i.e., a schematic diagram of detecting the starting time of a note and decoding the note;
[0051] Figure 2 It is a simple waveform diagram of the tuned segmented harmonic model;
[0052] Figure 3 Demonstration diagram of spectrum leakage of different segments of the tune segmentation model;
[0053] Figure 4 It is the start time detection result diagram;
[0054] Among them, (a) is the STFT time-frequency energy diagram; (b) is the ODF curve based on the spectrum leakage characteristics.
[0055] Figure 5 The chord and melody sheet music for the music "Lullaby";
[0056] Figure 6 This is a schematic diagram of the musical note decoding results;
[0057] Figure 7 FIG. 2 is a diagram showing a hardware implementation of the present invention. DETAILED DESCRIPTION
[0058] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention are described in further detail below.
[0059] Complex techniques will change the accuracy of starting point detection, so it is necessary to understand the nature of the starting point. Based on this point of view, the embodiment of the present invention attempts to explore the intrinsic connection between the starting time point and the tonality rhythm from the essence, and designs clear processing operations based on the theoretical knowledge of signal processing. The signal processing method does not involve complex operations generated by network training and optimization, resulting in higher efficiency and consuming less computing resources. It should be noted that in terms of ODF design, signal processing highlights spectral flux is the key [3,4,12] However, if some spectral parameters are not set properly or the observation angle is not appropriate, it will be difficult to discover the changing pattern of spectral flux.
[0060] The embodiment of the present invention proposes a start time detector based on spectrum leakage feature extraction, on which note decoding can also be performed. The main novelties are in the following three aspects:
[0061] (1) An embodiment of the present invention proposes a piecewise harmonic model of tonal music; (2) An embodiment of the present invention defines a good metric for evaluating the degree of spectral leakage at different positions of a music clip, from which an ODF curve can be drawn to capture the start time of the beat through the peak; (3) An embodiment of the present invention proposes a note decoding method.
[0062] The above contributions are based on a deep understanding of the tonal music spectrum. Both theoretical analysis and experimental results will verify the high accuracy and efficiency of the scheme.
[0063] Example 1
[0064] The embodiment of the present invention is based on the proposed segmented harmonic model of tonal music, from which it is found that the spectrum leakage effect becomes very serious at the boundary of adjacent notes, which is inspired to successfully detect the starting point of the note. In order to obtain a good evaluation of this effect, the embodiment of the present invention also derives a series of parameters of tonal music (including downsampling coefficient, FFT size, step size, etc.). When these conditions are met, a good metric reflecting the degree of spectrum leakage is defined, from which an intuitive note starting point detection function curve can be drawn, so as to search for the starting position by peak selection. Combining the note starting point detection results with the standard piano pitch table, the final notes can be decoded one by one by simple similar frequency matching. Experiments have shown that the scheme has high accuracy in both detection tasks and decoding tasks.
[0065] 1. Overall process of the embodiment of the present invention
[0066] The embodiment of the present invention proposes a tonal music note starting point detection and note decoding device based on spectrum leakage feature extraction, and the specific process is as follows: Figure 1 As shown:
[0067] The specific steps are as follows:
[0068] Input: Tonal music sample, detection frequency lower limit f min =210Hz,f max =840Hz, spectrum threshold ratio α=0.1, 12 equal temperament note-pitch table.
[0069] Step 1: Downsample the input audio to reduce its sampling rate to F s =6300samples / s;
[0070] Step 2: Perform sliding FFT analysis on the downsampled audio sequence using a Hanning window of length 1024 (corresponding to frequency resolution Δf = f s / N=6.15Hz), the sliding step is 1 sample point, and as the window covers the entire audio sequence, a short-time Fourier transform (STFT) time-spectrum diagram |X(m,k)| (m is the time index and k is the frequency index) is generated;
[0071] Step 3: For each moment m, Search for the maximum value X of |X(m,k)| max , and in k∈[k min ,k max ] The internal statistics show that its FFT amplitude spectrum is greater than αX max Spectrum , and calculate the percentage η(m) of the number of spectral lines and the total number of spectral lines;
[0072]
[0073] Step 4: At time m, draw η(m) as the endpoint detection function curve (Onset Detection Function, ODF), and detect the extreme points of the curve as the starting time position of each note;
[0074] Step 5: Search for the peak spectrum number k of the corresponding FFT spectrum at the middle position of the starting time of adjacent notes in turn p , and calculate the corresponding pitch frequency k p Δf;
[0075] Step 6: k p Δf is compared with the reference frequency of each note (eg, the "Do" note) in the 12-tone equal temperament note-pitch table, and the note with the smallest frequency difference is found as the note decoding result of the current period.
[0076] In the above steps, all note starting point detection is completed by Step 4, and all note decoding is completed by Step 6. It should be emphasized that all the above operations are based on the spectrum leakage degree of tonal music, and its technical principle is detailed as follows.
[0077] 2. Technical principle of the present invention
[0078] 2.1 Piecewise Harmonic Model of Tonal Music
[0079] The embodiment of the present invention models the tonal music as a piecewise harmonic model. Specifically, a tonal music is composed of a series of beats, and each beat is different in duration and harmonic components.
[0080] In order to explain the segmented harmonic model in detail, the signal x(t) with a time of 3.0938 seconds is used as an example. The formula is:
[0081]
[0082] In equation (2), the first half of x(t) is a single tone with a frequency of f1 = 7.1 Hz, and the second half is a single tone with a frequency of f2 = 16.3 Hz. The waveform of x(t) is as follows: Figure 2 shown.
[0083] like Figure 2 As shown, the embodiment of the present invention uses the sampling rate f s =64samples / s, three segments with the same time length (1 second) are extracted from x(t), namely t∈[0.0469s,1., t∈[1.0469s,2.0313s], t∈[2.0313s,3.0313s]. In addition, these three segments are fast Fourier transformed using a 64-point Hanning window, and their amplitude spectra |X1(k)|,|X2(k)|,|X3(k)| are as follows Figure 3 shown.
[0084] from Figure 3 It can be found that the three spectra |X1(k)|, |X2(k)|, |X3(k)| exhibit different degrees of spectral leakage. Specifically, for the first and third parts, they both contain only a single pure tone, the degree of spectral leakage is very small, and the spectral energy is mainly concentrated in a narrow area centered on the peak (k=6 and k=16, respectively). However, for the second part, the spectral leakage is very serious, which is manifested as the side lobes spreading in a wider area around the two peaks, because this part is not pure and has two tones mixed. In addition, it can be found that the height of the peak |X2(k)| is smaller than the height of the peak in |X1(k)|, |X3(k)||, reflecting that spectral leakage weakens the height of the peak.
[0085] The above example is a simplified description of tonal music. The embodiment of the present invention considers that the signal model in equation (2) can be extended to actual tonal music and can be expressed as (for the area covering adjacent beats):
[0086]
[0087] Among them, {A k ,f k ,θ k},k=1,...,K1 and They represent the amplitude, frequency and initial phase of the previous beat and the next beat respectively.
[0088] As will be discussed in more detail later, a high degree of spectral leakage also implies transitions from one musical note to another.
[0089] 2.2 STFT parameter setting conditions for starting point detection
[0090] The parameters related to STFT include FFT size N, window type and step size Δd. In addition, as mentioned above, in order to reduce the computational complexity, the input music record needs to be downsampled. For a song of tonal music, a single beat usually fluctuates around the period T, which can be roughly known in advance. At the same time, in order to achieve note decoding, it is necessary to link these STFT parameters with the pitch table.
[0091] Assume N is the FFT size and the original sampling rate is F s (F s =44.1ksamp1es / s), the downsampling factor is D, and the sampling rate is:
[0092] f s =F s / D (4)
[0093] The number of samples in a beat cycle is:
[0094] N T =Tf s =TF s / D (5)
[0095] The frequency resolution of the FFT, Δf, is equal to:
[0096] Δf=f s / N=F s / (DN) (6)
[0097] To ensure that the FFT window can be within a complete beat time period without covering any area between the previous beat duration and the next beat duration, the time period should be at least twice the FFT size, that is, the following inequality should hold:
[0098] N T >2N(7)
[0099] In addition, in order to distinguish the piano notes on the spectrum, the minimum interval of the pitch frequency table (i.e., the O4, O5 area listed in the table) should exceed twice the frequency resolution. As shown in Table 1, the minimum interval is equal to the difference between notes A and b B (i.e., 233.082Hz-220Hz=13.082Hz), so the following inequality should also hold:
[0100] Δf<13.082 / 2=6.541(8)
[0101] Table 1 Piano pitch and corresponding frequency table
[0102]
[0103] Considering parameter conditions (4)-(8), the embodiment of the present invention sets the STFT parameters to:
[0104] The downsampling factor D = 7 and the FFT size N = 1024. Therefore, in terms of equation (4), the sampling rate is reduced to f s =F s / D = 44100 / 7 = 6300 samples / s. Substituting the conventional beat cycle value T = 0.41s into formula (5) will give the number of samples N in one beat cycle: T =Tf s =2583, then, considering that the FFT size should be an integer power of 2, the feasible FFT size can be determined based on the inequality in equation (7) and N=1024, from which the frequency resolution can be calculated as:
[0105] Δf=f s / N=6.1523Hz
[0106] In addition, the step size of the STFT is specified as Δd = N / 16 = 64, which is the same as the step size Δt = Δd / f s =0.0102, indicating sufficiently high tracking accuracy. In addition, the Hanning window can be selected as a commonly used window type.
[0107] Note that Δf also satisfies inequality (8), which proves that all the above STFT-related parameters are suitable for note onset detection.
[0108] 2.3 ODF construction based on spectrum leakage feature extraction
[0109] Essentially, the construction of the onset detection function is to define a metric that evaluates the degree of spectrum leakage. Specifically, as the observation time window moves, this metric should be small when the observation time window completely enters the beat duration without overlapping any part of the adjacent beat duration. Thereafter, as the observation window continues to move forward, the overlap must increase, which also leads to an increase in this metric. However, as it gradually enters the next beat, the metric also tends to decrease. At the same time, changes like this are periodic.
[0110] In fact, in order to quantitatively calculate this metric, a frequency range f∈[f min ,f max ], the frequency range corresponds to the FFT index range as follows:
[0111] k∈[k min ,k max ],k min =f min / Δf,k max =f max / Δf(9)
[0112] In addition, when the observation window moves to the position of mΔt, it corresponds to the windowed FFT spectrum X(m,k) extracted from the STFT time-frequency distribution, where the peak is expressed as:
[0113]
[0114] The indicator is defined as:
[0115]
[0116] Where k is the frequency index; Δf is the frequency resolution; f min is the lower frequency limit; f max is the upper frequency limit; Δt=Δd / f s ;"card(·)" indicates Operator for performing statistical counting, α refers to the specified threshold ratio (a value of about 0.1 is recommended).
[0117] By using this metric, an ODF curve can be plotted in which the peak position can be selected as the note onset moment, as shown in later experimental results.
[0118] 2.4 Note decoding
[0119] After detecting the starting time point of the note, the note can also be decoded by analyzing the spectrum distribution within a given frequency range.
[0120] Take piano music as an example. Usually, a wonderful piano piece is played with two hands: the left hand hits the left piano keys to produce chords (spectral components are distributed in a relatively low-frequency area), and the right hand hits the right piano keys to produce melody (spectral components are distributed in a relatively high-frequency area). In essence, chords are designed based on melodies. Therefore, the embodiment of the present invention is actually intended to achieve note decoding of melodies in the frequency range of f∈[fmin,fmax].
[0121] Specifically, if Figure 1 As shown, assuming that the start time t of the mth note has been detected m and the start time t of the (m+1)th note m+1 , since they are adjacent notes, the middle time (t m +t m+1 ) / 2 is regarded as a reliable point for music decoding, corresponding to the STFT index:
[0122]
[0123] Wherein, Δd is the step size of the STFT; “[·]” represents the integer rounding operator.
[0124] Where "[·]" represents the integer rounding operator, the windowed FFT spectrum can be taken as a peak, and the peak spectrum index is found as:
[0125]
[0126] The melody frequency of this main spectrum is estimated to be:
[0127]
[0128] Finally, we can determine which piano key was pressed by looking up the piano pitch table to find the closest frequency. Furthermore, given a reference frequency (such as the frequency corresponding to the note "Do"), we can easily represent its note.
[0129] Example 2
[0130] Verification experiment
[0131] 3.1.ODF curve graph
[0132] Record a piano piece "Lullaby" and set the parameters mentioned in Section 2.2. According to the above-mentioned start time detection process, the embodiment of the present invention obtains Figure 4 The time-frequency distribution is shown.
[0133] Note decoding
[0134] After detecting the start time of the note duration, the embodiment of the present invention further performs a music decoding experiment (the reference frequency is 369.994 Hz, not "Do"). For this piece of music - "Lullaby", the chord and melody score is as follows Figure 5 shown.
[0135] Following the above note decoding process, all notes are retrieved. For ease of demonstration, the note decoding results are displayed on the STFT time-frequency distribution spectrum, as shown in Figure 6 shown.
[0136] The above details the design principle and results of the tonal music start time detection and note decoding based on spectrum leakage feature extraction proposed in the embodiment of the present invention, as well as the verification experiment done on this model, from which it can be seen that the embodiment of the present invention has the following beneficial effects:
[0137] (1) For the note starting point detection result, Figure 4 In the middle figure (a), we can see:
[0138] a. There are many horizontal stripes (from the changes of individual notes) clearly distributed on this STFT time-frequency diagram, showing a good energy concentration effect, which is actually attributed to the parameter settings described in Section 2.2.
[0139] b. There are also clear vertical streaks at the boundaries of adjacent notes, which are side reflections of spectral leakage as the viewing window traverses these transition regions, where the viewing window passes from one note to the next.
[0140] c. Note that within any note duration, there is a series of horizontal bars at different frequency positions, which verifies the correctness of the piecewise harmonic model for tonal music proposed in Section 2.1.
[0141] from Figure 4 In the middle figure (b), we can see:
[0142] a. The ODF curve will show the fluctuations described in Section 2.3, that is, the ODF curve will become smaller when the observation window is completely contained within the note, and will become larger when moving to the transition region between adjacent note durations.
[0143] b. Figure 4 The peak position in (b) (marked with an asterisk) occurs exactly at Figure 4 The position of the vertical stripes (representing the boundaries of adjacent beat durations) in (a). This result proves that the proposed onset time detection method has high positioning accuracy.
[0144] (2) For the note decoding results, combined Figure 5 and Figure 6 , you can see:
[0145] a. Figure 6 As shown, the note decoding results are highly consistent with the real double five-line stave.
[0146] b. In addition, the embodiment of the present invention has only a few decoding errors. For example, at 8s, the required decoding result should be the high note of the note "5", but it is decoded as the low note of the note "5". This is because the collected sound is a mixture of the left-hand chord and the right-hand melody. For the high note of the melody "5", the corresponding chord also happens to be the low note "5". Therefore, the decoding result depends entirely on the difference in the pressing strength of both hands, reflecting that the decoding result is also reasonable.
[0147] Example 3
[0148] Hardware implementation diagram Figure 7 The collected audio signal x(t) is sampled by A / D (analog-to-digital converter) to obtain a sample sequence x(n), which enters the DSP chip in the form of digital input. After being processed by the internal algorithm of the DSP chip, the signal after note decoding is output.
[0149] in, Figure 7 The DSP (Digital Signal Processor) is the core device, and the internal program flow is as follows Figure 1 As shown, it includes two parts: note starting point detection and note decoding.
[0150] Note onset detection: First, the input audio is downsampled using a factor of D. Then, the signal is subjected to STFT, which is set according to the note onset detection STFT parameter setting conditions introduced in Section 2.2. Next, the ODF curve is plotted by evaluating the degree of spectrum leakage and the peak extraction algorithm is used to find the note onset.
[0151] Note decoding: With the help of the retrieved note starting point, find the frequency with the highest energy from the corresponding peak bin. Then decode this frequency into a note according to the pitch table. You can retrieve all notes by repeating the above operation and traversing all time.
[0152] The embodiment of the present invention implants the core algorithm of "tonal music note starting point detection and note decoding device based on spectrum leakage feature extraction" into the DSP device, and completes high-precision, low-complexity and efficient music signal analysis based on it.
[0153] Unless otherwise specified, the models of the components in the embodiments of the present invention are not limited, and any device that can perform the above functions may be used.
[0154] Those skilled in the art will appreciate that the accompanying drawing is only a schematic diagram of a preferred embodiment, and the serial numbers of the embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0155] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting the starting point of a tonal music note and decoding the note, characterized in that: The method comprises: Draw η(m) as the endpoint detection function curve, and detect the extreme points of the curve as the starting time positions of the musical notes of each tonality; In the middle of the starting time of adjacent notes Search out its corresponding FFT spectrum The peak spectrum number k p , and calculate the corresponding pitch frequency k p Δf; Compare the pitch frequency with the reference frequency of each note in the 12-tone equal temperament note-pitch table, and find the note with the smallest frequency difference as the note decoding result of the current period; Where N is the FFT size and the original sampling rate is F s , the downsampling factor is D, and the sampling rate is: f s =F s / D; The number of samples in a beat cycle is: N T =Tf s =TF s / D; The frequency resolution of the FFT, Δf, is equal to: Δf=f s / N=F s / (DN); The specific method of drawing η(m) as the endpoint detection function curve is: The frequency range corresponds to the FFT index range as follows: k∈[k min ,k max ],k min =f min / Δf,k max =f max / Δf When the observation window moves to the position of mΔt, it corresponds to the windowed FFT spectrum X(m,k) extracted from the STFT time-frequency distribution, where the peak is expressed as: The indicator is defined as: Where k is the frequency index; Δf is the frequency resolution; f min is the lower frequency limit; f max is the upper frequency limit; Δt=Δd / f s ;"card(·)" indicates Operator for statistical counting, α refers to the specified threshold ratio; Detect the start time t of the mth note m and the start time t of the (m+1)th note m+1 , the intermediate time (t m +t m+1 ) / 2 is regarded as a reliable point for music decoding, corresponding to the STFT index: Where Δd is the step size of the STFT; "[·]" represents the integer rounding operator.
2. A method for detecting the starting point of a tonal music note and decoding the note according to claim 1, characterized in that: The method models tonal music as a piecewise harmonic model, which is extended to actual tonal music and expressed as: Among them, {A k ,f k ,θ k },k=1,...,K1 and k=1,...,K2 represent the amplitude, frequency and initial phase of the previous beat and the next beat respectively.
3. A method for detecting the starting point of a tonal music note and decoding the note according to claim 2, characterized in that: The time period is at least twice the FFT size, N T >2N,N T is the number of samples in the beat period, and N is the FFT size.
4. A device for detecting the starting point of a tonal music note and decoding the note, characterized in that: The device comprises: a processor and a memory, wherein the memory stores program instructions, and the processor calls the program instructions stored in the memory to enable the device to execute the method steps described in any one of claims 1-3.
Citation Information
Patent Citations
Musical note segmenting method based on Teager energy entropy
CN102129858A
Multi-pitch estimation method based on note transient dictionary and stable dictionary
CN112259063A
Multi-tone electronic organ music note identification method based on constant Q transformation
CN112420071A
Note starting point detection method and system
CN112509601A
Method and device for extracting a melody underlying an audio signal
US20060075884A1
