CN-121725813-B - Lute string fundamental frequency determining method and system
Abstract
The invention provides a lute string fundamental frequency determining method and system, which are characterized in that audio signals are subjected to time-frequency transformation, frequency spectrum peaks are extracted, peak energy is weighted according to a preset harmonic attenuation function, a candidate fundamental frequency set is set, a preliminary harmonic cluster is firstly constructed based on an initial non-harmonic coefficient, a real-time non-harmonic coefficient is calculated by selecting an energy highest cluster, then a candidate harmonic cluster is reconstructed by the coefficient, each harmonic cluster is evaluated from two aspects of harmonic energy continuity and time domain relativity respectively, namely, the sum of harmonic energy is calculated, loss penalty is combined to obtain an energy continuity score, meanwhile, the time relativity score is obtained through the time cross-correlation average of energy envelopes of fundamental frequency and harmonic components, and the comprehensive score is obtained after weighted summation.
Inventors
- WANG TING
Assignees
- 中央民族大学
Dates
- Publication Date
- 20260505
- Application Date
- 20260211
Claims (5)
- 1. The method for determining the fundamental frequency of the strings of the lute is characterized by comprising the following steps of: Extracting a spectrum peak value from each spectrum frame of the time-frequency spectrogram, and weighting the energy of the spectrum peak value according to a preset lute tone harmonic attenuation function to obtain a weighted peak value set; The method comprises the steps of setting a candidate fundamental frequency set, searching and constructing a primary candidate harmonic cluster in a weighted peak set for each candidate fundamental frequency according to an initial non-harmonic coefficient, selecting a primary candidate harmonic cluster with the highest energy sum, and calculating to obtain a real-time non-harmonic coefficient based on the actual frequency of a harmonic in the primary candidate harmonic cluster; The method comprises the steps of selecting a harmonic cluster, accumulating the energy of all weighted peaks in the harmonic cluster, applying continuity penalty according to the missing condition of the harmonic in a preset order to obtain an energy continuity score, extracting the energy envelopes of the fundamental frequency component in the harmonic cluster and other harmonic components on continuous frequency spectrum frames, calculating the average value of time cross correlation coefficients between the energy envelopes of the fundamental frequency component and the energy envelopes of other harmonic components to obtain a time correlation score, and carrying out weighted summation on the energy continuity score and the time correlation score to obtain a comprehensive score; Selecting a candidate harmonic cluster with highest comprehensive score, and determining a candidate fundamental frequency corresponding to the harmonic cluster as the fundamental frequency of the lute string; The weighting the energy of the spectrum peak value according to a preset lute tone harmonic attenuation function comprises the following steps: weighted energy The calculation formula is as follows: , wherein, As the original energy of the spectral peak with harmonic order n, Is a preset attenuation factor; the searching and constructing candidate harmonic clusters in the weighted peak value set for each candidate fundamental frequency by utilizing the real-time non-harmonic coefficient comprises the following steps: for each candidate fundamental frequency And the real-time non-harmonic coefficient B is used for calculating the theoretical frequency of the kth harmonic according to the following non-harmonic relation ; And at the theoretical frequency Searching the peak value with the largest energy in the weighted peak value set in an upper preset frequency window and a lower preset frequency window as a kth harmonic component; the step of accumulating the energy of all weighted peaks in the harmonic cluster and applying a continuity penalty according to the missing condition of the inner harmonic of a preset order to obtain an energy continuity score comprises the following steps: Summing the energy of all weighted peaks in the candidate harmonic cluster to obtain energy sum; counting the number m of missing harmonics in a predetermined order range and multiplying the energy sum by a predetermined penalty factor To the power of m, to obtain the energy continuity score; extracting the energy envelopes of the fundamental frequency component and other harmonic components in the harmonic cluster on continuous frequency spectrum frames, and calculating the average value of time cross-correlation coefficients between the energy envelopes of the fundamental frequency component and the energy envelopes of other harmonic components to obtain a time correlation score, wherein the method comprises the following steps: extracting energy envelopes of the fundamental frequency components and N harmonic components in a preset order range; Calculating a time cross-correlation coefficient between the energy envelope of the fundamental frequency component and the energy envelope of each harmonic component; And calculating an arithmetic average value of all the calculated cross-correlation coefficients to obtain the time correlation score.
- 2. The method of claim 1, wherein the time-frequency transform is a short-time fourier transform and is set with a predetermined sampling rate, window function, window length, and frame shift.
- 3. The method of claim 1, wherein the setting the set of candidate fundamental frequencies comprises: and generating discrete candidate fundamental frequency points in a preset frequency range with a preset frequency resolution to form the candidate fundamental frequency set.
- 4. The method of claim 1, wherein said weighting and summing the energy continuity score with the time correlation score results in a composite score, comprising: And respectively setting weight coefficients for the energy continuity score and the time correlation score, and carrying out weighted summation on the energy continuity score and the time correlation score through the weight coefficients to obtain the comprehensive score.
- 5. A lute string fundamental frequency determination system for implementing a method according to any of claims 1 to 4, comprising the following modules: The extraction module is used for obtaining the audio signals of the strings of the lute and performing frequency conversion to obtain a time-frequency spectrogram, extracting a frequency spectrum peak value in each frequency spectrum frame of the time-frequency spectrogram, and weighting the energy of the frequency spectrum peak value according to a preset lute tone harmonic wave attenuation function to obtain a weighted peak value set; The construction module is used for setting a candidate fundamental frequency set, searching and constructing a primary candidate harmonic cluster in the weighted peak value set for each candidate fundamental frequency according to an initial non-harmonic coefficient, selecting a primary candidate harmonic cluster with the highest energy sum, and calculating to obtain a real-time non-harmonic coefficient based on the actual frequency of the harmonic in the primary candidate harmonic cluster; The calculation module is used for accumulating the energy of all weighted peaks in each candidate harmonic cluster, applying continuity penalty according to the missing condition of the harmonic in a preset order to obtain an energy continuity score, extracting the energy envelopes of the fundamental frequency component in the harmonic cluster and the rest harmonic components on continuous frequency spectrum frames, calculating the average value of time cross correlation coefficients between the energy envelopes of the fundamental frequency component and the rest harmonic components to obtain a time correlation score, and carrying out weighted summation on the energy continuity score and the time correlation score to obtain a comprehensive score; and the determining module is used for selecting a candidate harmonic cluster with the highest comprehensive score, and determining the candidate fundamental frequency corresponding to the harmonic cluster as the fundamental frequency of the lute string.
Description
Lute string fundamental frequency determining method and system Technical Field The application belongs to the field of fundamental frequency determination, and particularly relates to a lute string fundamental frequency determination method and system. Background Lute is used as an important national plucked instrument, and expansion and contraction of a panel, a product and a phase and tension change of nylon steel wire strings jointly cause tone shift, and particularly, the tone is required to be frequently checked before performance. The prior art is mainly an external electronic tuning device, and cannot solve the problem of real-time and tiny intonation offset caused by environmental change in the musical instrument, and the key point is to realize automatic tuning and to identify fundamental frequency, namely pitch. The overtones of lute are not strictly integer multiples of the fundamental frequency, i.e. there is a phenomenon of non-harmony, so that the performance of the method based on the ideal harmonic model is reduced. When the lute is played, the higher harmonic energy is attenuated rapidly, even some harmonic components are possibly missing, so that algorithms depending on complete harmonic structures are easy to misjudge, such as octaves or pentads. In addition, the impulse noise generated in the moment of plucking strings has large energy and wide frequency spectrum, and is easy to interfere with the detection of stable harmonic components, thereby affecting the accuracy and stability of the algorithm. Currently, the dominant fundamental frequency determining algorithms can be divided into several types, such as time domain, frequency domain, time-frequency domain, and the like. The time domain method such as the autocorrelation function method estimates the fundamental frequency by the periodicity of the signal, but is sensitive to phase variation and susceptible to noise interference. The frequency domain methods such as the harmonic summation method and the harmonic product spectrum method utilize the energy distribution characteristics of harmonic waves, but the method is difficult to cope with the non-harmonic problem existing in musical instruments such as lute and the like, and is easy to fail when fundamental frequency components are lost. The prior art rarely combines harmonic structure continuity with time varying information of each harmonic component when processing instrument signals with complex harmonic structures and non-harmonics. Therefore, how to design a method for processing non-harmony, suppressing noise interference and improving the accuracy of determining the fundamental frequency of the lute string by comprehensively utilizing the frequency spectrum and the time domain features is a problem to be solved in the current technical field. Disclosure of Invention The invention provides a method for determining fundamental frequency of a lute string, which is used for solving the problems that in the prior art, when the fundamental frequency of the lute is determined, the non-harmony is difficult to process, noise interference is inhibited, and the fundamental frequency of the lute string is determined with insufficient accuracy due to the fact that frequency spectrum and time domain characteristics are not comprehensively utilized, and comprises the following steps: Extracting a spectrum peak value from each spectrum frame of the time-frequency spectrogram, and weighting the energy of the spectrum peak value according to a preset lute tone harmonic attenuation function to obtain a weighted peak value set; The method comprises the steps of setting a candidate fundamental frequency set, searching and constructing a primary candidate harmonic cluster in a weighted peak set for each candidate fundamental frequency according to an initial non-harmonic coefficient, selecting a primary candidate harmonic cluster with the highest energy sum, and calculating to obtain a real-time non-harmonic coefficient based on the actual frequency of a harmonic in the primary candidate harmonic cluster; The method comprises the steps of selecting a harmonic cluster, accumulating the energy of all weighted peaks in the harmonic cluster, applying continuity penalty according to the missing condition of the harmonic in a preset order to obtain an energy continuity score, extracting the energy envelopes of the fundamental frequency component in the harmonic cluster and other harmonic components on continuous frequency spectrum frames, calculating the average value of time cross correlation coefficients between the energy envelopes of the fundamental frequency component and the energy envelopes of other harmonic components to obtain a time correlation score, and carrying out weighted summation on the energy continuity score and the time correlation score to obtain a comprehensive score; And selecting a candidate harmonic cluster with highest comprehensive score, and determining the candidate fund