Anti-howling method based on RISC processor
By performing time-domain frequency domain conversion, howling detection, notch and frequency shift processing of audio signals on the audio processing chip based on the RISC processor, the problem that the audio processing chip based on the RISC processor does not have the anti-domain function is solved, and the effect of effectively suppressing howling sounds while reducing costs is achieved.
Patent Information
- Application Number
- CN202411987027.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-22
AI Technical Summary
In audio playback home appliances with added microphone function modules, audio processing chips based on RISC processors usually do not have anti-whistling function, making it difficult to avoid the generation of whistling sounds while reducing costs.
By obtaining the audio signal and using the time domain frequency domain conversion function of the RISC processor to convert it into a frequency domain signal, howling detection is performed to obtain the howling frequency point generated, then notch processing and frequency shift processing of the frequency domain signal, and finally convert the processed signal into a time domain signal and output it.
It realizes that while reducing production costs, it effectively suppresses the generation of whistling tones, prevents the microphone input audio signal and the speaker output audio signal from cycling feedback and amplifying at a certain frequency point, causing whistling tones.
Smart Images

Figure CN119864044A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of anti-howling, and in particular to an anti-howling method based on a RISC processor. Background Art
[0002] In order to realize the multifunctionality of small audio playing household appliances such as Blu-ray players, it is considered to add a microphone function module to such audio playing household appliances. However, adding the microphone function module may also generate howling sounds. If the production cost is not considered, the howling sounds can be suppressed by using a chip with a direct anti-howling function. However, considering the actual cost of the product, manufacturers will give priority to using relatively low-priced chips, such as AP8224 and other RISC processor-based audio processing chips. However, since such chips are usually used in products without microphones such as speakers to process the sound effects of the speaker output sound, they basically do not have an anti-howling function. Therefore, how to reduce costs while ensuring that howling sounds are avoided when applied to small audio playing household appliances that support microphones is a problem that needs to be solved. Summary of the invention
[0003] The invention provides a howling prevention method based on a RISC processor, so as to overcome the technical problem that an audio processing chip based on a RISC processor does not have the howling prevention function.
[0004] In order to achieve the above object, the technical solution of the present invention is:
[0005] A method for preventing howling based on a RISC processor, the specific steps comprising:
[0006] S1: Acquire the audio signal and convert the audio signal from a time domain signal to a frequency domain signal through the built-in time domain to frequency domain conversion function of the RISC processor;
[0007] S2: Performing howling detection based on the frequency domain signal to obtain a howling frequency point;
[0008] S3: performing notch processing on the frequency domain signal based on the frequency point generating the howling, to obtain a frequency domain signal after notch processing;
[0009] S4: performing frequency shift processing on the frequency domain signal after the notch processing to obtain a frequency shifted signal;
[0010] S5: converting the frequency-shifted signal into a processed time domain signal;
[0011] S6: amplify the processed time domain signal according to the set maximum gain and output it.
[0012] Further, in S2, the process of performing howling detection based on the frequency domain signal to obtain the frequency point generating howling is:
[0013] Calculate the power ratio of the peak value to the mean value of each frequency point in the frequency domain signal. The calculation formula is:
[0014] PAPR = 10log10(P_peak / P_avg)
[0015] Where, P_peak is the peak power of each frequency point; P_avg is the average power of all frequencies;
[0016] The power ratio of the peak value to the average value of all frequency points is compared with the set threshold, and the frequency points exceeding the threshold are taken as candidate howling frequency points;
[0017] Calculate the peak power and adjacent power ratio of the candidate howling frequency point and its M adjacent frequency points on the left and right. The calculation formula is:
[0018] PNPR=101og10(P_peak' / P_adjacent)
[0019] Wherein, P_peak' is the peak power corresponding to the candidate howling frequency point and its M adjacent frequency points on the left and right; P_adjacent is the peak power of the candidate howling frequency point and its M adjacent frequency points on the left and right;
[0020] Compare the two peak power and adjacent power ratios of the candidate howling frequency point with the peak power and adjacent power ratios corresponding to the M adjacent frequency points on its left and right;
[0021] and determining whether the ratios of the two peak powers to the adjacent power values of the candidate howling frequency point are both the highest values in all comparisons, if yes, retaining the candidate howling frequency point; otherwise, eliminating the candidate howling frequency point;
[0022] The peak-to-average power ratio of each retained candidate howling frequency is calculated again. If the peak-to-average power ratio of the retained candidate howling frequency exceeds the set threshold for N consecutive frames and the peak-to-average power ratio continues to increase, then this candidate howling frequency is determined to be a howling frequency.
[0023] Further, in S3, the process of performing notch processing on the frequency domain signal based on the frequency point generating the howling, thereby reducing the gain value of the frequency point generating the howling, is as follows:
[0024] The frequency domain signal is input into the filter built into the RISC processor, and the processing gain of the filter for the frequency point generating howling is set at the same time, so that the filter can perform gain reduction processing, i.e., notch operation, on the frequency point generating howling according to the setting.
[0025] Further, in S4, the frequency domain signal after the notch processing is subjected to frequency shift processing using the following formula to obtain the frequency domain signal after the frequency shift processing, namely:
[0026]
[0027] Wherein, W1 is the frequency of the frequency domain signal after notch processing; W0 is the local oscillator signal frequency, i.e., the frequency shift frequency; A is the signal amplitude; Φ is the signal phase.
[0028] Furthermore, the frequency shift value is -3 Hz.
[0029] Furthermore, in the setting of the processing gain of the filter for the frequency point generating howling, the processing gain is -10db.
[0030] Beneficial effect: Based on the existing audio processing software, the present invention adds an anti-howling function, performs howling detection based on the frequency domain signal to obtain the howling frequency point, performs notch processing on the frequency domain signal based on the howling frequency point, and performs frequency shift processing on the frequency domain signal after the notch processing. After a series of processing, the conditions for the howling sound are destroyed, preventing the microphone input audio signal and the speaker output audio signal from cyclically feedback amplifying at a certain frequency point to cause howling sound, thereby achieving the effect of suppressing howling sound. Based on this method, it can meet the demand for suppressing howling sound while reducing production costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0032] Figure 1 A flowchart of a RISC processor-based anti-howling method in the present invention;
[0033] Figure 2 FIG. 4 is a flow chart of an anti-howling algorithm in an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] This embodiment provides a method for preventing howling based on a RISC processor, such as Figure 1 and Figure 2 As shown, the specific steps include:
[0036] S1: Acquire the audio signal and convert the audio signal from a time domain signal to a frequency domain signal through the built-in time domain frequency domain conversion function of the RISC processor;
[0037] Specifically, in this embodiment, the anti-howling operation is performed based on the AP8224 chip, and the audio signal is converted from the time domain to the frequency domain through Fourier transform; according to the computing power of the AP8224 chip, when performing Fourier transform, the sampling rate Fs=16KHz is set, and the data processed in each frame is N=1024 points, so the frequency positioning accuracy is Fs / N=15.6Hz; at the same time, in order to improve the frequency resolution, in this embodiment, the time domain zero padding method is adopted, and 1024 zero points are padded at the end of the time domain. After the signal is converted from a time domain signal to a frequency domain signal, the frequency positioning accuracy can be improved to 7.8Hz.
[0038] Specifically, in addition to being applicable to the AP8224 chip, the method proposed in this embodiment can also be used to suppress howling in other chips that meet the following conditions, including: (1) a built-in 32-bit RISC processor with a maximum frequency of not less than 240 MHz; (2) support for 1024-point complex FFT / IFFT operations; (3) support for analog audio signal input and output interfaces with a sampling rate of not less than 48 KHz; In this embodiment, anti-howling processing is performed based on the low-cost AP8224 chip, which has a built-in 32-bit RISC processor with a maximum frequency of 240 MHz and integrated 224 KB SRAM and 16 Mbit Flash.
[0039] S2: Performing howling detection based on the frequency domain signal to obtain a howling frequency point;
[0040] Specifically, after the audio signal undergoes fast Fourier transform, from the frequency domain signal, the power of the normal frequency point changes irregularly, and only the frequency point where the howling occurs is a fixed frequency point, and its power is much greater than that of other frequencies and continues to increase. Therefore, in this embodiment, the peak-to-mean power ratio and the peak-to-adjacent power ratio are calculated to determine whether the corresponding frequency point is the frequency point where the howling occurs.
[0041] In a specific embodiment, in S2, the process of performing howling detection based on the frequency domain signal to obtain the frequency point generating howling is as follows:
[0042] Calculate the power ratio of the peak value to the mean value of each frequency point in the frequency domain signal. The calculation formula is:
[0043] PAPR = 10log10(P_peak / P_avg)
[0044] Where, P_peak is the peak power of each frequency point; P_avg is the average power of all frequencies;
[0045] The power ratio of the peak value to the average value of all frequency points is compared with the set threshold, and the frequency points exceeding the threshold are taken as candidate howling frequency points;
[0046] Calculate the peak power to adjacent power ratio of the candidate howling frequency point and its M adjacent frequency points on the left and right, 5≤M≤15, the calculation formula is:
[0047] PNPR=101og10(P_peak' / P_adjacent)
[0048] Wherein, P_peak' is the peak power corresponding to the candidate howling frequency point and its M adjacent frequency points on the left and right; P_adjacent is the peak power of the candidate howling frequency point and its M adjacent frequency points on the left and right;
[0049] Compare the two peak power and adjacent power ratios of the candidate howling frequency point with the peak power and adjacent power ratios corresponding to the M adjacent frequency points on its left and right;
[0050] and determining whether the ratios of the two peak powers to the adjacent power values of the candidate howling frequency point are both the highest values in all comparisons, if yes, retaining the candidate howling frequency point; otherwise, eliminating the candidate howling frequency point;
[0051] Specifically, in this embodiment, M is set to 10 to avoid misjudgment caused by a too small value of M and an increase in the reaction time of the howling processing caused by a too large value of M.
[0052] The peak-to-average power ratio of each retained candidate howling frequency is calculated again. If the peak-to-average power ratio of the retained candidate howling frequency exceeds the set threshold for N consecutive frames, and the peak-to-average power ratio continues to increase, 5≤N≤20, then this candidate howling frequency is determined to be a howling frequency.
[0053] Specifically, in this embodiment, N is set to 5.
[0054] Specifically, in this embodiment, the frequency domain signal is processed by equalization and dynamic compression to reduce the gain value of the frequency point generating the howling sound, that is, the frequency point generating the howling sound in the speaker output signal is notched, and the howling frequency point will not be fed back to the microphone and superimposed with the frequency of the original audio signal input by the microphone, thereby destroying the conditions for the howling sound to be generated, and it can be prevented that the microphone input audio signal and the speaker output audio signal are cyclically fed back and amplified at a certain frequency point to cause the howling sound, thereby suppressing the howling sound.
[0055] Specifically, in this embodiment, according to actual debugging results, the gain of the frequency point where howling occurs is set to -10 db.
[0056] S3: performing notch processing on the frequency domain signal based on the frequency point generating howling, wherein the frequency domain signal after notch processing, specifically, can reduce the gain value of the frequency point generating howling through notch operation;
[0057] In a specific embodiment, in S3, the process of performing notch processing on the frequency domain signal based on the frequency point generating the howling is as follows:
[0058] The frequency domain signal is input into the filter built into the RISC processor, and the processing gain of the filter for the frequency point generating howling is set at the same time, so that the filter can perform gain reduction processing, i.e., notch operation, on the frequency point generating howling according to the setting.
[0059] S4: performing frequency shift processing on the frequency domain signal after the notch processing to obtain a frequency shifted signal;
[0060] Specifically, in this embodiment, after the audio signal is processed by the above-mentioned notch wave, the howling sound suppression has achieved obvious effect. However, in some special cases, such as when the microphone pickup point is artificially brought close to the speaker, howling sound will still be generated. Therefore, a frequency shifting operation is added in this embodiment to further suppress the howling.
[0061] In a specific embodiment, in S4, the frequency domain signal after notch processing is subjected to frequency shift processing using the following formula to obtain the frequency domain signal after frequency shift processing, namely:
[0062]
[0063] Wherein, W1 is the frequency of the frequency domain signal after notch processing; W0 is the local oscillator signal frequency, i.e., the frequency shift frequency; A is the signal amplitude; Φ is the signal phase.
[0064] Specifically, in this embodiment, different frequency shift values are substituted into the above formula respectively, and the appropriate frequency shift value is selected by listening to whether the output signal is distorted. In this embodiment, through actual testing, the frequency shift value is set to -3Hz, so that the speaker output signal will not be superimposed on the original audio signal frequency input by the microphone after being picked up again by the microphone through the feedback loop, thereby destroying the conditions for the generation of howling sounds. This setting can not only ensure that the clarity and distortion of the microphone sound output meet the design requirements, but also fully suppress the howling sound.
[0065] S5: converting the frequency-shifted signal into a processed time domain signal;
[0066] Specifically, the frequency-shifted frequency-domain signal is converted into a processed time-domain signal through inverse Fourier transform.
[0067] S6: amplify the processed time domain signal according to the set maximum gain and then output it.
[0068] Specifically, this gain control is to control the microphone output volume through an external microphone volume control switch (potentiometer). In principle, the larger the output volume, the larger the audio signal transmitted back to the microphone pickup port through the feedback path, which makes howling more likely to occur. Therefore, by reasonably setting the maximum gain here and the maximum gain of the subsequent power amplifier chip, it is not advisable to set the maximum gain too large while ensuring normal use by the user.
[0069] Specifically, according to actual debugging results, the set maximum gain is 8db.
[0070] At this point, the process of processing audio signals based on the AP8224 chip is completed, and the processed audio signals are sent to the external power amplifier chip. After amplification by the power amplifier chip, the sound emitted by the microphone is finally output through the speaker, and it can be found that no howling sound is generated.
[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for preventing howling based on a RISC processor, characterized in that: The specific steps include: S1: Acquire the audio signal and convert the audio signal from a time domain signal to a frequency domain signal through the built-in time domain to frequency domain conversion function of the RISC processor; S2: Performing howling detection based on the frequency domain signal to obtain a howling frequency point; S3: performing notch processing on the frequency domain signal based on the frequency point generating the howling, to obtain a frequency domain signal after notch processing; S4: performing frequency shift processing on the frequency domain signal after the notch processing to obtain a frequency shifted signal; S5: converting the frequency-shifted signal into a processed time domain signal; S6: amplify the processed time domain signal according to the set maximum gain and output it.
2. The anti-howling method based on RISC processor according to claim 1 is characterized in that: In S2, the process of performing howling detection based on the frequency domain signal to obtain the frequency point where howling is generated is: Calculate the power ratio of the peak value to the mean value of each frequency point in the frequency domain signal. The calculation formula is: PAPR = 10log10(P_peak / P_avg) Where, P_peak is the peak power of each frequency point; P_avg is the average power of all frequencies; The power ratio of the peak value to the average value of all frequency points is compared with the set threshold, and the frequency points exceeding the threshold are taken as candidate howling frequency points; Calculate the peak power and adjacent power ratio of the candidate howling frequency point and its M adjacent frequency points on the left and right. The calculation formula is: PNPR=101og10(P_peak' / P_adjacent) Wherein, P_peak' is the peak power corresponding to the candidate howling frequency point and its M adjacent frequency points on the left and right; P_adjacent is the peak power of the candidate howling frequency point and its M adjacent frequency points on the left and right; Compare the two peak power and adjacent power ratios of the candidate howling frequency point with the peak power and adjacent power ratios corresponding to the M adjacent frequency points on its left and right; and determining whether the ratios of the two peak powers to the adjacent power values of the candidate howling frequency point are both the highest values in all comparisons, if yes, retaining the candidate howling frequency point; otherwise, eliminating the candidate howling frequency point; The peak-to-average power ratio of each retained candidate howling frequency is calculated again. If the peak-to-average power ratio of the retained candidate howling frequency exceeds the set threshold for N consecutive frames and the peak-to-average power ratio continues to increase, then this candidate howling frequency is determined to be a howling frequency.
3. The anti-howling method based on RISC processor according to claim 2 is characterized in that: In S3, the process of performing notch processing on the frequency domain signal based on the frequency point generating howling, thereby reducing the gain value of the frequency point generating howling is as follows: The frequency domain signal is input into the filter built into the RISC processor, and the processing gain of the filter for the frequency point generating howling is set at the same time, so that the filter can perform gain reduction processing, i.e., notch operation, on the frequency point generating howling according to the setting.
4. The anti-howling method based on RISC processor according to claim 3 is characterized in that: In S4, the frequency domain signal after notch processing is subjected to frequency shift processing using the following formula to obtain the frequency domain signal after frequency shift processing, namely: Wherein, W1 is the frequency of the frequency domain signal after notch processing; W0 is the local oscillator signal frequency, i.e., the frequency shift frequency; A is the signal amplitude; Φ is the signal phase.
5. The anti-howling method based on RISC processor according to claim 4 is characterized in that: The frequency shift value is -3 Hz.
6. The anti-howling method based on RISC processor according to claim 5, characterized in that: The processing gain of the filter for the frequency point generating howling is set to -10 db.
Citation Information
Cited By
Howling processing method and device, electronic equipment and storage medium
CN120935495A