Disclosure of Invention
The application aims to provide a TEOAE feedback signal generation method and device based on software simulation, which are used for solving the problem that in the prior art, a TEOAE detection device cannot provide an accurate feedback signal so as to possibly cause inaccurate hearing test results.
Another objective of the present application is to provide a method and an apparatus for generating a TEOAE feedback signal based on software simulation, so as to solve the problem that in the prior art, a TEOAE detection device mostly adopts fixed test parameters, and cannot flexibly adjust the signal to noise ratio of a frequency point according to a requirement of a setter.
It is still another object of the present application to provide a method and apparatus for generating a TEOAE feedback signal based on software simulation, so as to solve the problem that the prior art lacks an effective method for verifying the performance of the nonlinear differential averaging method.
In order to achieve the above purpose, the present application adopts the following technical scheme:
in a first aspect of the present application, a software simulation-based TEOAE feedback signal generating method is provided, including the steps of:
Preprocessing an audio signal received by audio input equipment, and determining the intensity of a stimulus signal according to the preprocessed audio signal;
Acquiring a preset feedback intensity relation table, and searching a feedback intensity value matched with the stimulation signal intensity in the feedback intensity relation table;
calculating the intensity of an output signal value according to the feedback intensity value, and setting the waveform type and waveform parameters of the output signal based on the intensity of the output signal value;
generating an output signal according to the waveform type and the waveform parameters, and evaluating a feedback effect according to the output signal;
and if the evaluation result shows that the feedback effect does not reach the set target, adjusting the feedback intensity relation table and the waveform parameters and re-evaluating the feedback effect until the feedback effect reaches the set target.
Preferably, the preprocessing the audio signal received by the audio input device and determining the stimulus signal intensity according to the preprocessed audio signal includes:
Collecting an audio signal received by audio input equipment and converting the audio signal into a digital signal;
Filtering the digital signal, and extracting first signal intensity from the filtered digital signal;
And judging whether the first signal intensity exceeds a set threshold value, and if so, extracting the stimulus signal intensity from the filtered digital signal.
Preferably, the setting the waveform type and waveform parameters of the output signal based on the output signal value intensity includes:
and selecting matched output signal waveforms according to the intensity of the output signal values, and setting waveform parameters, wherein the waveform parameters comprise sampling frequencies, signal duration time, a frequency component list and an intensity list of frequency components.
Preferably, the generating an output signal according to the waveform type and waveform parameters includes:
Calculating sampling points in the signal duration according to the sampling frequency and the signal duration, and generating a time axis based on the sampling points;
And determining a mathematical expression of the output signal according to the waveform type, and inputting corresponding data in the time axis, the frequency component list and the intensity list into the mathematical expression to obtain the output signal.
Preferably, the feedback effect evaluation according to the output signal includes:
Inputting the output signal into audio playing equipment for playing to obtain an acoustic signal;
Performing frequency spectrum analysis on the acoustic signal by utilizing fast Fourier transform to obtain frequency spectrum data, and extracting initial signal values of all frequency components from the frequency spectrum data;
And calculating the deviation between each initial signal value and the corresponding expected output value, and determining the feedback effect according to the calculation result.
Preferably, the determining the feedback effect according to the calculation result includes:
When the deviation of each initial signal value and the corresponding expected output value is not in the set range, judging that the feedback effect does not reach the set target, and taking the frequency component corresponding to the initial signal value with the deviation exceeding the set range as the object to be adjusted.
Preferably, the adjusting the feedback intensity relation table and the waveform parameters and re-evaluating the feedback effect includes:
Optimizing an initial signal value of the frequency component to be adjusted according to the deviation, and adjusting a feedback intensity value corresponding to the frequency component to be adjusted in the feedback intensity relation table, a signal duration time, a frequency component list and an intensity list of the frequency component in the waveform parameter according to the optimized signal value;
and recalculating an output signal according to the adjustment result, and evaluating the feedback effect according to the new output signal.
In a second aspect of the present application, there is provided a TEOAE feedback signal generating apparatus based on software simulation, comprising:
the preprocessing module is used for preprocessing the audio signals received by the audio input equipment and determining the strength of the stimulation signals according to the preprocessed audio signals;
The searching module is used for acquiring a preset feedback intensity relation table and searching a feedback intensity value matched with the stimulation signal intensity in the feedback intensity relation table;
The setting module is used for calculating the intensity of the output signal value according to the feedback intensity value and setting the waveform type and waveform parameters of the output signal based on the intensity of the output signal value;
The evaluation module is used for generating an output signal according to the waveform type and the waveform parameters and evaluating the feedback effect according to the output signal;
And the adjusting module is used for adjusting the feedback intensity relation table and the waveform parameters and re-evaluating the feedback effect if the evaluation result shows that the feedback effect does not reach the set target, until the feedback effect reaches the set target.
In a third aspect of the present application, there is provided an electronic device comprising a memory and a processor, the memory for storing one or more computer instructions, wherein the one or more computer instructions are executable by the processor to implement a software simulation based TEOAE feedback signal generating method as claimed in any one of the preceding claims.
In a fourth aspect of the present application, there is provided a computer-readable storage medium storing a computer program which, when executed by a computer, implements a software simulation-based TEOAE feedback signal generating method as set forth in any one of the above.
The application has the following beneficial effects:
1. The application ensures that feedback can be triggered only when the signal strength reaches a certain level through scientific and reasonable threshold setting, thereby effectively avoiding false triggering or missed triggering, further improving the accuracy and reliability of signal identification, and further checking the reflection of equipment under different signal strengths through setting different thresholds, thereby checking the qualification of DNLR algorithm, ensuring the reliability of TEOAE detection equipment in practical application and improving the trust degree of users on the TEOAE detection equipment.
2. According to the application, through optimizing the signal identification process, the TEOAE detection equipment can work stably in practical application, and an error result caused by false triggering or missed triggering is avoided.
3. According to the application, a user can self-define the feedback intensity relation table and the waveform parameters according to the requirements, different test requirements are met, and the adaptability and the flexibility of the TEOAE detection equipment are improved.
4. The method can generate the composite signal containing a plurality of frequency components, can be applied to more complex test scenes, such as the detection of TEOAE test equipment, and improves the test capability and application range of the TEOAE test equipment.
5. The application has a feedback adjustment mechanism, so that a user can adjust a feedback intensity relation table and waveform parameters according to an effect evaluation result, thereby optimizing a feedback effect and improving the self-adaptability and the optimizing capability of the equipment.
Detailed Description
In order to make the technical scheme of the application clearer, the application is further described in detail below with reference to the attached drawings and specific embodiments. The terms "first," "second," and the like in the claims and the description of the application, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order, and it is to be understood that the terms so used may be interchanged, if appropriate, merely to describe the manner in which objects of the same nature are distinguished in the embodiments of the application by the description, and furthermore, the terms "comprise" and "have" and any variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of elements is not necessarily limited to those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a TEOAE feedback signal generating method based on software simulation according to the present embodiment. The TEOAE feedback signal generating method based on software simulation as shown in fig. 1 may be executed by a computer or a server, or software on the computer or the server, and specifically includes the following steps:
s110, preprocessing an audio signal received by audio input equipment, and determining the strength of a stimulus signal according to the preprocessed audio signal;
S120, acquiring a preset feedback intensity relation table, and searching a feedback intensity value matched with the intensity of the stimulation signal in the feedback intensity relation table;
s130, calculating the intensity of an output signal value according to the feedback intensity value, and setting the waveform type and waveform parameters of the output signal based on the intensity of the output signal value;
s140, generating an output signal according to the waveform type and the waveform parameters, and evaluating the feedback effect according to the output signal;
And S150, if the evaluation result shows that the feedback effect does not reach the set target, adjusting the feedback intensity relation table and the waveform parameters, and re-evaluating the feedback effect until the feedback effect reaches the set target.
According to the method and the device, the response of the human ear to the TEOAE stimulation signal is simulated to generate the feedback signal containing the specific frequency component, so that scientific and reasonable threshold setting is realized, feedback is ensured to be triggered only when the signal strength reaches a certain level, false triggering or missing triggering is effectively avoided, the accuracy and reliability of signal identification are improved, a user can customize a feedback intensity relation table and waveform parameters according to requirements, different test requirements are met, the adaptability and flexibility of the TEOAE detection device are improved, and meanwhile, a feedback adjustment mechanism is further provided, so that the user can adjust the feedback intensity relation table and the waveform parameters according to the feedback effect evaluation result, further, the feedback effect is optimized, and the self-adaptability and the optimizing capability of the device are improved.
Further, preprocessing an audio signal received by the audio input device, and determining a stimulus signal intensity according to the preprocessed audio signal, including:
collecting an audio signal received by audio input equipment and converting the audio signal into a digital signal;
filtering the digital signal, and extracting first signal intensity from the filtered digital signal;
And judging whether the first signal strength exceeds a set threshold value, and if so, extracting the stimulus signal strength from the filtered digital signal.
Firstly, the audio input device is connected to the acquisition device, preferably, the audio input device is a microphone, the acquisition device is used for acquiring an audio signal received by the microphone in real time, the audio signal is converted into a digital signal, then, filtering processing is carried out on the digital signal obtained through conversion to remove noise and interference, the signal quality is improved, and then, feature extraction is carried out on the filtered digital signal to obtain a first signal strength, preferably, a peak equivalent sound pressure level (peSPL) is calculated according to the filtered digital signal, and peSPL is a measurement mode of sound signal strength, particularly when a short-time sound signal is processed. Thus, in this embodiment, the obtaining the first signal strength is essentially the calculation peSPL.
A threshold of signal strength is set according to the actual requirement for determining whether to trigger feedback, and preferably, the threshold is set to 75dB peSPL in this embodiment. The basic idea of the nonlinear differential averaging DNLR method is that the intensity of the TEOAE feedback signal increases with the intensity of the stimulus signal when the stimulus signal is weak, and that the intensity of the TEOAE feedback signal tends to saturate when the stimulus signal is increased to about 70dB peSPL, and does not increase with the increase of the stimulus signal. The DNLR algorithm is the only method for eliminating the artifacts, and all the devices need to realize the TEOAE test, so that the situation of false triggering or missed triggering can be effectively avoided only by setting a scientific and reasonable threshold value, and the reflection of the TEOAE detection device under different signal intensities can be checked by setting different threshold values, so that whether the DNLR algorithm can process signals correctly is judged.
Comparing the obtained first signal strength with a set threshold value, if the first signal strength exceeds the set threshold value, the feedback is triggered, that is, the stimulus signal exists in the filtered digital signal, and the stimulus signal is extracted from the filtered digital signal to obtain the stimulus signal strength.
When a plurality of different thresholds are set, if the stimulus signal is judged to be present in the filtered digital signal under the high threshold and not under the low threshold, the DNLR algorithm is judged to be qualified because it can correctly process signals of different intensities. By checking the legitimacy of the DNLR algorithm, the reliability of the TEOAE detection equipment in practical application can be ensured, and the trust degree of the user on the equipment is further improved.
Then, a preset feedback intensity relation table is obtained, wherein the table can also be user-defined and set, different stimulus signal intensities and corresponding feedback intensity values are contained in the table, the corresponding feedback intensity values are searched in the table according to the extracted stimulus signal intensities, after the corresponding feedback intensity values are found, the output signal value intensity is calculated according to the searched feedback intensity values, specifically, the feedback intensity values are corrected to obtain the output signal value intensity, then a proper output waveform type is selected according to the output signal value intensity and actual requirements, and corresponding waveform parameters are set. In the process of generating the TEOAE feedback signal, the signal is finally output, but the signal is usually represented in the form of a waveform, specifically, the output signal is a time sequence, which represents sound pressure values at different time points, and the time sequence can be visualized as a waveform diagram, and can also be saved as an audio file (such as a WAV file) for further use or playing.
The waveform parameters include sampling frequency (sampling_rate), signal duration (duration), frequency component list (frequencies) and intensity list (amplitudes) of corresponding frequency components, preferably, in this embodiment, the output waveform type is sinusoidal waveform, sampling frequency is 64000Hz, signal duration is 0.008 seconds, frequency component list is [1000,1500,2000,3000,4000] Hz, elements therein represent frequency components contained in the signal, intensity list of frequency components is [0.9,0.05,0.05,0.05,0.05], elements therein represent intensities of frequency components, wherein the sampling frequency is not modifiable by system settings, and the signal duration, frequency component list and intensity list of frequency components can be adjusted to meet detection requirements of the oae detection device.
Further, generating an output signal according to the waveform type and the waveform parameters, comprising:
calculating sampling points in the signal duration according to the sampling frequency and the signal duration, and generating a time axis based on the sampling points;
And determining a mathematical expression of the output signal according to the waveform type, and inputting corresponding data in the time axis, the frequency component list and the intensity list into the mathematical expression to obtain the output signal.
Calculating the number of samples in the signal duration from the sampling frequency and the signal duration, in particular, the number of samples = sampling frequency x signal duration, generating a time axis using the linspace function in the Numpy library, the length of the time axis being the number of samples in the signal duration, wherein Numpy is the library in the programming language Python, a number of mathematical functions and operations are provided, in particular for the operation of an array (multidimensional array), in the Numpy library the linspace function is used to generate an arithmetic array which is evenly distributed between the specified start value (start) and end value (stop) and contains the specified number of samples, in a simple manner, the linspace function generates a one-dimensional array between the start value and end value in an equally spaced manner, the number of elements in the array being specified by the user, and at the same time a zero array (signal) of the same length as the time axis is created for storing the generated signal values.
Based on the selected output waveform type, a signal is generated using a corresponding mathematical expression for each frequency component, in this embodiment a sine waveform, and a sine function is used to generate the signal, specifically:
sifnal+=amp*sin(2*π*freq*t),
wherein sifnal + represents that the signal value corresponding to each frequency component in the frequency component list is accumulated into a zero array signal, amp is an array variable, wherein each element corresponds to the intensity of one frequency component, the array can be used for independently controlling the intensity of one specific frequency component to generate a signal with a single frequency, so that the test of the single frequency component is completed, and also can be used for simultaneously controlling the intensities of a plurality of frequency components to generate a composite signal, so that the test of a plurality of frequency components is completed in a combined way, f req represents the frequency of the frequency component, and t represents the time point on a time axis. By generating a composite signal containing a plurality of frequency components, the method can be applied to more complex test scenes, and the application range of the TEOAE detection equipment is increased.
Further, performing feedback effect evaluation according to the output signal, including:
inputting the output signal into audio playing equipment for playing to obtain an acoustic signal;
Processing the acoustic signal by using fast Fourier transform to obtain frequency spectrum data, and extracting initial signal values of all frequency components from the frequency spectrum data;
And calculating the deviation between each initial signal value and the corresponding expected output value, and determining the feedback effect according to the calculation result.
The calculated output waveform is output to an audio playing device, preferably, the audio playing device is a loudspeaker, the loudspeaker emits sound, the emitted sound is controlled according to the requirement, such as volume, and the sound signal in the loudspeaker is collected through a microphone or other acoustic sensors, so that the collected sound signal can accurately reflect the acoustic environment in the loudspeaker. Through the sound control function, output sound can be controlled according to the requirement, so that the expected effect is achieved, and the practicality and user experience of the TEOAE detection equipment are improved.
The acquired acoustic signal is subjected to spectrum analysis by using a Fast Fourier Transform (FFT), which is a mathematical transformation for converting a time domain signal into a frequency domain signal, and is capable of providing an intensity distribution of the signal at different frequencies, calculating an initial signal value of each frequency component, i.e., a spectrum signal value, according to the obtained spectrum data, essentially determining and quantifying an intensity (or amplitude) corresponding to each frequency component from the spectrum data of the signal, wherein the spectrum is a distribution diagram describing each frequency component and its corresponding intensity (or amplitude) in the signal, on the spectrum diagram, a horizontal axis represents the frequency component, a vertical axis represents the intensity (or amplitude) of the corresponding frequency component, and then calculating a deviation of each spectrum signal value from its corresponding expected output value, preferably E i=Hi-Hi set, wherein E i represents an i frequency error, H i represents an i-th spectrum signal value, H i set represents an expected output value corresponding to the i-th frequency component, i respectively taking 1000hz, 2000hz, 3000hz and 4000hz, and performing feedback evaluation according to the deviation.
Further, adjusting the feedback intensity relationship table and the waveform parameters and re-evaluating the feedback effect includes:
Optimizing an initial signal value of the frequency component to be adjusted according to the deviation, and adjusting a feedback intensity corresponding to the frequency component to be adjusted in a feedback intensity relation table, a signal duration time in a waveform parameter and an intensity list of the frequency component according to the optimized signal value;
and recalculating an output signal according to the adjustment result, and evaluating the feedback effect according to the new output signal.
If the obtained deviation exceeds the set range, it is determined that the feedback effect does not reach the set target, preferably, the set range is E i less than +/-1 dB, the frequency components corresponding to the initial signal values with the deviation exceeding the set range are taken as objects to be adjusted, the initial signal values of each object to be adjusted are optimized, specifically, for each object to be adjusted, if the deviation is positive and is too large, the signal values of the objects to be adjusted are considered to be too large, the signals of the frequency components are weakened, if the deviation is negative and is too large, the signal values of the objects to be adjusted are considered to be too small, the signals of the frequency components are enhanced, and the optimization process may need multiple iterations until the satisfactory output effect is achieved.
And adjusting the feedback intensity in the feedback intensity relation table, the signal duration time in the waveform parameter, the frequency component list and the intensity list of the frequency component according to the optimized frequency spectrum signal value.
And after all the adjustment is finished, carrying out feedback effect evaluation again to judge whether the feedback effect reaches the set target, and if the effect is still poor, repeating the parameter adjustment and feedback effect evaluation steps again until the feedback effect reaches the set target.
The TEOAE detection equipment is provided with a feedback adjustment mechanism, so that a user can adjust a feedback intensity relation table and waveform parameters according to an effect evaluation result, further, the feedback effect is optimized, and the self-adaptability and the optimizing capability of the equipment are improved.
Example 2
Fig. 2 is a schematic structural diagram of a TEOAE feedback signal generating device based on software simulation according to the present embodiment. As shown in fig. 2, the software simulation-based TEOAE feedback signal generating apparatus includes:
the preprocessing module is used for preprocessing the audio signals received by the audio input equipment and determining the strength of the stimulation signals according to the preprocessed audio signals;
The searching module is used for acquiring a preset feedback intensity relation table and searching a feedback intensity value matched with the intensity of the stimulation signal in the feedback intensity relation table;
The setting module is used for calculating the intensity of the output signal value according to the feedback intensity value and setting the waveform type and waveform parameters of the output signal based on the intensity of the output signal value;
The evaluation module is used for generating an output signal according to the waveform type and the waveform parameters and evaluating the feedback effect according to the output signal;
And the adjusting module is used for adjusting the feedback intensity relation table and the waveform parameters and re-evaluating the feedback effect if the evaluation result shows that the feedback effect does not reach the set target, until the feedback effect reaches the set target.
The method provided by the embodiment is used for realizing the method provided by all the embodiments, and has the corresponding beneficial effects of the method. Technical details not described in detail in this embodiment can be found in the methods provided in all the foregoing embodiments of the application.
Example 3
Fig. 3 is a schematic structural diagram of an electronic device according to the present embodiment. As shown in fig. 3, the electronic device includes a memory 301 and a processor 302, where the memory 301 is configured to store one or more computer instructions, and the one or more computer instructions are executed by the processor 302 to implement a software simulation-based TEOAE feedback signal generating method as described above.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the electronic device described above may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
A computer-readable storage medium storing a computer program which, when executed by a computer, causes the computer to implement a software simulation-based TEOAE feedback signal generating method as described above.
By way of example, a computer program may be divided into one or more modules/units stored in the memory 301 and executed by the processor 302 and completed by the input interface 305 and the output interface 306 to complete the present application, and one or more modules/units may be a series of computer program instruction segments capable of performing specific functions for describing the execution of the computer program in a computer device.
The computer device may be a desktop computer, a notebook computer, a palm computer, a cloud server, or the like. The computer device may include, but is not limited to, a memory 301, a processor 302, it will be understood by those skilled in the art that the present embodiment is merely an example of a computer device and is not limiting of a computer device, may include more or fewer components, or may combine certain components, or different components, e.g., a computer device may also include an input 307, a network access device, a bus, etc.
The Processor 302 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors 302, digital signal processors 302 (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor 302 may be a microprocessor 302 or the processor 302 may be any conventional processor 302 or the like.
The memory 301 may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. The memory 301 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, and further, the memory 301 may also include an internal storage unit of the computer device and an external storage device, the memory 301 may be used to store computer programs and other programs and data required by the computer device, and the memory 301 may also be used to temporarily store the programs and data in the output device 308, where the foregoing storage media include a usb disk, a removable hard disk, a read-only memory ROM303, a random access memory RAM304, a disk or an optical disk, and other various media that can store program codes.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.