Method and device for adjusting pink noise peak factor and signal testing method
By calculating and adjusting the effective value and amplitude of the pink noise signal, precise control of the peak factor is achieved, which solves the problem of the inability to increase the peak factor and changes in the spectrum characteristics in the prior art, and meets the needs of signal testing.
Patent Information
- Application Number
- CN202411497918.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2024-12-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When using signal limiting to adjust the pink noise peak factor in the prior art, the peak factor cannot be increased and the spectrum characteristics of the signal will be changed, which cannot meet the needs of certain signal testing.
By calculating the effective value and peak factor of the pink noise signal, judging the difference with the target peak factor, adjusting the effective value and amplitude of the signal, and iteratively calculate using the amplitude adjustment function until the target peak factor is reached, ensuring that the signal spectrum characteristics remain unchanged.
Accurate adjustment of the peak factor is achieved, which can be reduced and increased without changing the spectrum characteristics of the signal to meet the testing needs.
Smart Images

Figure CN119094042A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of signal testing technology, and in particular to a method and device for adjusting a pink noise peak factor, and a signal testing method. Background Art
[0002] Pink noise is a signal or process with a spectrum whose power spectral density is inversely proportional to the frequency band. In hearing, since the human ear perceives sound in logarithmic (octave) terms, at short waves (high frequencies), the bandwidth of each octave is greater, which makes the power spectral density offset the bandwidth, resulting in the intensity of each octave being actually equal.
[0003] Characteristics of pink noise: Pink noise has a higher pitch, and the volume varies at different frequencies, but the intensity of each octave is equal. This sound characteristic makes pink noise appear to have a stable and monotonous wavelength in hearing. Pink noise is a commonly used signal in signal testing and has a wide range of applications in many fields; for example: audio equipment testing, room acoustic characteristics testing, environmental acoustics measurement, hearing hypersensitivity treatment, and sleep aid research, etc.
[0004] In the process of signal testing, it is often necessary to pre-set the type and parameters of the test signal. Some tests require pink noise, but the crest factor of pink noise generated by general technical methods cannot be changed (the definition of crest factor is the ratio of the peak value of the signal to the effective value), and some tests have certain requirements for the crest factor of the signal. Therefore, in order to meet the requirements, the crest factor of the pink noise signal needs to be adjusted to meet the test needs.
[0005] The conventional method of adjusting the signal crest factor is to adjust it by signal limiting. Limiting means that when the amplitude of the signal exceeds a certain set range, it is made equal to the value of the set range. However, this method has the following shortcomings:
[0006] (1) Signal limiting operation will change the spectral characteristics of the original signal;
[0007] (2) Signal limiting operation can only reduce the peak factor of the signal, but cannot increase the peak factor of the signal, because the purpose of limiting is to change the maximum value of the signal to achieve the effect of adjusting the peak factor of the signal. Summary of the invention
[0008] The purpose of the present application is to overcome the problem in the prior art that the peak factor of a pink signal adjusted by limiting the amplitude will change the spectrum characteristics of the original signal and cannot increase the peak factor of the signal, and to provide a method, device and signal testing method for adjusting the peak factor of pink noise.
[0009] In a first aspect, a method for adjusting a pink noise peak factor is provided, comprising:
[0010] S100, obtaining a pink noise signal;
[0011] S200, calculating the effective value and peak factor of the pink noise signal;
[0012] S300, determining whether the absolute value of the difference between the peak factor of the pink noise signal and the target peak factor is less than a preset threshold;
[0013] If the judgment result is no, the effective value and amplitude of the pink noise signal are adjusted, and the process returns to step S200;
[0014] If the judgment result is yes, a pink noise signal is output.
[0015] In some possible implementations, calculating the effective value and the peak factor of the pink noise signal includes:
[0016] Calculate the effective value of the pink noise signal:
[0017] ;
[0018] Among them, S 0rms is the effective value of the pink noise signal, S0 is the pink noise signal;
[0019] Calculating the maximum value of the pink noise signal;
[0020] Calculate the peak factor of the pink noise signal according to the effective value and the maximum value:
[0021] ;
[0022] Where cr0 is the peak factor of the pink noise signal, S 0max is the maximum value of the pink noise signal.
[0023] In some possible implementations, the effective value of the pink noise signal is adjusted, including: multiplying the pink noise signal by an adjustment constant, wherein an initial value of the adjustment constant is 1.0; if the peak factor of the pink noise signal is greater than a target peak factor, increasing the adjustment constant; if the peak factor of the pink noise signal is less than the target peak factor, decreasing the adjustment constant.
[0024] In some possible implementations, adjusting the amplitude of the pink noise signal includes: adjusting the amplitude of the pink noise signal by using an amplitude adjustment function, wherein the amplitude adjustment function is:
[0025] ;
[0026] Among them, S 0irepresents an element in the pink noise signal, k is a constant, k corresponds to the adjustment factor of the adjustment function, S newi For element S 0i The element after being adjusted by the amplitude adjustment function.
[0027] In a second aspect, a device for adjusting a pink noise peak factor is provided, comprising:
[0028] An acquisition module, used for acquiring a pink noise signal;
[0029] A calculation module, used for calculating the effective value and peak factor of the pink noise signal;
[0030] An iteration module, used for determining whether the absolute value of the difference between the peak factor of the pink noise signal and the target peak factor is less than a preset threshold;
[0031] If the judgment result is no, the effective value and amplitude of the pink noise signal are adjusted, and the process jumps to the calculation module;
[0032] If the judgment result is yes, a pink noise signal is output.
[0033] In some possible implementations, the calculation module includes:
[0034] The first calculation submodule is used to calculate the effective value of the pink noise signal:
[0035] ;
[0036] Among them, S 0rms is the effective value of the pink noise signal, S0 is the pink noise signal;
[0037] A second calculation submodule, used for calculating the maximum value of the pink noise signal;
[0038] The third calculation submodule is used to calculate the peak factor of the pink noise signal according to the effective value and the maximum value:
[0039] ;
[0040] Where cr0 is the peak factor of the pink noise signal, S 0max is the maximum value of the pink noise signal.
[0041] In some possible implementations, the effective value of the pink noise signal is adjusted, including: multiplying the pink noise signal by an adjustment constant, wherein an initial value of the adjustment constant is 1.0; if the peak factor of the pink noise signal is greater than a target peak factor, increasing the adjustment constant; if the peak factor of the pink noise signal is less than the target peak factor, decreasing the adjustment constant.
[0042] In some possible implementations, adjusting the amplitude of the pink noise signal includes: adjusting the amplitude of the pink noise signal by using an amplitude adjustment function, wherein the amplitude adjustment function is:
[0043] ;
[0044] Among them, S 0i represents an element in the pink noise signal, k is a constant, k corresponds to the adjustment factor of the adjustment function, S newi For element S 0i The element after being adjusted by the amplitude adjustment function.
[0045] In a third aspect, a signal testing method is provided, which adjusts the pink noise peak factor by using a method as in any one of the implementations of the first aspect.
[0046] In a fourth aspect, an electronic device is provided, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements a method as in any one of the implementations in the first aspect above.
[0047] This application has the following beneficial effects:
[0048] 1. This application can accurately adjust the peak factor, not only to reduce the peak factor of pink noise, but also to increase the peak factor of pink noise, and output pink noise corresponding to a high-precision and controllable peak factor, which can meet the needs of certain test signals;
[0049] 2. The method of adjusting the amplitude through the amplitude adjustment function of the present application adjusts the signal peak factor by adjusting the effective value and the peak value at the same time according to the law of the amplitude adjustment function, thereby achieving the control of the peak factor of the original pink noise signal without changing the spectral characteristics of the signal, and solving the problem that the ordinary limiting method will affect the spectral characteristics of the signal. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0052] Figure 1 is a flow chart of a method for adjusting a pink noise peak factor of the present application;
[0053] Figure 2 is a flow chart of a method for adjusting a pink noise peak factor according to Embodiment 1 of the present application;
[0054] Figure 3 is a structural block diagram of a device for adjusting a pink noise peak factor according to Embodiment 2 of the present application;
[0055] Figure 4 It is a schematic diagram of the internal structure of the electronic device of Example 4 of the present application.
[0056] Reference numerals:
[0057] 100, acquisition module; 200, calculation module; 201, first calculation submodule; 202, second calculation submodule; 203, third calculation submodule; 300, iteration module. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0059] Example 1
[0060] like Figure 1 and Figure 2 As shown, a method for adjusting the peak factor of pink noise involved in Embodiment 1 of the present application includes:
[0061] S100, first obtain the generated pink noise signal S0;
[0062] S200, calculating the effective value and the peak factor cr0 of the pink noise signal, the specific steps are as follows:
[0063] Calculate the effective value S of the pink noise signal S0 0rms , the effective value is calculated as follows: , and then calculate the maximum value S of the pink noise signal S0 0max , then the crest factor cr0 of the pink noise signal is expressed as: ;
[0064] It should be noted that after calculating the initial peak factor cr0 of the pink noise signal S0, it is necessary to determine whether the initial peak factor meets the user's needs. If not, a specific value crE of the peak factor of the pink noise to be adjusted is set. The specific value crE is the target peak factor, and the absolute value Q of the difference between the peak factor of the pink noise signal and the target peak factor crE is set to a certain value to meet the user's needs. The target peak factor crE can be greater than cr0 or less than cr0. For example, the peak factor of the current pink noise signal is 1.6, the target peak factor is set to 1.5, and the absolute value Q of the difference is set to 0.05. Since |1.6-1.5|=0.1>0.05, the current pink noise signal cannot meet the user's needs and needs to be adjusted. In addition, according to the calculation formula, it can be seen that the value of the peak factor is at least 1.0.
[0065] After setting the target peak factor crE that needs to be adjusted and the absolute value Q of the difference that can meet user needs (that is, the preset threshold Q), it is necessary to calculate the peak factor adjustment. The calculation process mainly involves first adjusting the effective value of the pink noise signal, and then adjusting the amplitude through the amplitude adjustment function, and performing iterative calculations until the peak factor that meets user needs is obtained. In theory, the smaller the absolute value Q of the difference, the better, that is, the smaller the Q, the closer the peak factor of the pink noise signal is to the target peak factor. However, in order to control the calculation efficiency, the absolute value of the difference can be set to relatively large values such as Q=0.05, 0.08, 0.09, etc. Of course, the absolute value of the difference can also be set to smaller values such as Q=0.004, 0.006, 0.009, etc. In other words, the value of Q can be customized according to the actual needs of the user and the control of calculation efficiency.
[0066] S300, determining whether the absolute value of the difference between the peak factor of the pink noise signal and the target peak factor is less than a preset threshold;
[0067] If the judgment result is no, the effective value and amplitude of the pink noise signal are adjusted, and the process returns to step S200;
[0068] If the judgment result is yes, a pink noise signal is output.
[0069] Specifically, the pink noise signal obtained in step S100 is first judged for the first time, and the content of the judgment is: whether the absolute value of the difference between the peak factor of the original pink noise signal and the target peak factor is less than the preset threshold value Q. If the absolute value of the difference between the peak factor of the original pink noise signal and the target peak factor is less than the preset threshold value Q, it means that the peak factor of the original pink noise signal can already meet the user's demand, and thus no adjustment is required. However, if the absolute value of the difference between the peak factor of the original pink noise signal and the target peak factor is greater than or equal to the preset threshold value Q, it means that the peak factor of the original pink noise signal cannot meet the user's demand, and in this case, the original pink noise signal needs to be adjusted.
[0070] After determining that the original pink noise signal needs to be adjusted, the original pink noise signal is first adjusted by the effective value. The effective value adjustment method is to multiply the original pink noise signal by the adjustment constant C. The initial value of the adjustment constant C is 1.0. After the original pink noise signal is adjusted by the effective value, the amplitude is adjusted by the amplitude adjustment function. The amplitude adjustment function is:
[0071]
[0072] Among them, S 0i represents an element in the pink noise signal, k is a constant, k corresponds to the adjustment factor of the adjustment function, S newi For element S 0i The elements adjusted by the amplitude adjustment function can be adjusted to obtain the adjusted pink noise signal S new .
[0073] After the adjustment, the pink noise signal S new After that, it is necessary to return to step S200 to recalculate the adjusted pink noise signal S new Then, step S300 is performed to determine the adjusted pink noise signal S new Whether the peak factor of the adjusted pink noise signal S can meet the user's needs, that is, to determine whether the adjusted pink noise signal S new Whether the absolute value of the difference between the peak factor of the target peak factor is less than the preset threshold Q; if it is greater than or equal to the preset threshold Q, it means that the user demand is not met or the condition for iteration termination is not met, and the adjusted pink noise signal S new If the peak factor of the adjusted pink noise signal S is greater than the target peak factor, the adjustment constant C is increased. new If the peak factor of the adjusted signal is less than the target peak factor, reduce the adjustment constant C; adjust the adjusted constant C value according to the above steps to adjust the pink noise signal S newThe effective value and amplitude are adjusted again, and the process is repeated until the peak factor of the adjusted pink noise signal meets the user's requirements, or satisfies the preset iteration stop condition, and the adjusted pink noise signal is output at this time.
[0074] In this embodiment, a method for adjusting the peak factor of pink noise is proposed. The method can accurately adjust the peak factor, not only can the peak factor of pink noise be reduced, but also can the peak factor of pink noise be increased. The pink noise corresponding to the peak factor with high output accuracy and controllable can meet the needs of certain test signals.
[0075] In addition, an amplitude adjustment function is proposed in the present embodiment. The amplitude adjustment function adjusts the amplitude of the original pink noise signal. The traditional limiting method directly changes the maximum value of the original signal, which will cause the spectrum of the signal to change, thereby affecting the signal test effect. The method of adjusting the amplitude through the amplitude adjustment function in the present embodiment adjusts the peak factor of the signal by adjusting the effective value and the peak value at the same time according to the law of the amplitude adjustment function. After testing, it is found that the spectrum characteristics of the original pink noise signal are basically retained, thereby achieving the control of the size of the peak factor of the original pink noise signal without changing the spectrum characteristics of the signal, and solving the problem that the ordinary limiting method will affect the spectrum characteristics of the signal.
[0076] Example 2
[0077] like Figure 3 As shown, a device for adjusting a pink noise peak factor according to Embodiment 2 of the present application includes:
[0078] An acquisition module 100 is used to acquire a pink noise signal;
[0079] A calculation module 200, used to calculate the effective value and peak factor of the pink noise signal;
[0080] Specifically, the calculation module 200 includes:
[0081] The first calculation submodule 201 is used to calculate the effective value of the pink noise signal:
[0082] ;
[0083] Among them, S 0rms is the effective value of the pink noise signal, S0 is the pink noise signal;
[0084] A second calculation submodule 202, configured to calculate the maximum value of the pink noise signal;
[0085] The third calculation submodule 203 is used to calculate the peak factor of the pink noise signal according to the effective value and the maximum value:
[0086] ;
[0087] Where cr0 is the peak factor of the pink noise signal, S 0max is the maximum value of the pink noise signal.
[0088] An iteration module 300 is used to determine whether the absolute value of the difference between the peak factor of the pink noise signal and the target peak factor is less than a preset threshold;
[0089] If the judgment result is no, the effective value and amplitude of the pink noise signal are adjusted, and the process jumps to the calculation module 200, wherein the effective value adjustment includes: multiplying the pink noise signal by an adjustment constant, wherein the initial value of the adjustment constant is 1.0, and if the peak factor of the pink noise signal is greater than the target peak factor, then the adjustment constant is increased; if the peak factor of the pink noise signal is less than the target peak factor, then the adjustment constant is decreased; and the amplitude adjustment includes: adjusting the amplitude of the pink noise signal by an amplitude adjustment function, wherein the amplitude adjustment function is:
[0090] ;
[0091] Among them, S 0i represents an element in the pink noise signal, k is a constant, k corresponds to the adjustment factor of the adjustment function, S newi For element S 0i The element adjusted by the amplitude adjustment function;
[0092] If the judgment result is yes, a pink noise signal is output.
[0093] It should be noted that, for other specific implementations of the device for adjusting the peak factor of pink noise in this embodiment, reference may be made to the specific implementation of the method for adjusting the peak factor of pink noise described above, which will not be described again here to avoid redundancy.
[0094] Example 3
[0095] A signal testing method involved in Embodiment 3 of the present application uses a method as in any one of the implementations in Embodiment 1 above to adjust the peak factor of pink noise, wherein the signal test includes audio equipment testing, speaker audio effect testing, room acoustic characteristics testing, environmental acoustic measurement, hearing hypersensitivity treatment, and sleep assistance research, etc.;
[0096] Among them, the computer-readable storage medium can be a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM); the computer-readable storage medium can store program code, and when the program stored in the computer-readable storage medium is executed by the processor, the processor is used to execute the steps of the method in any one of the implementation methods in Example 1 of the present application.
[0097] Example 4
[0098] like Figure 4 As shown, an electronic device involved in Embodiment 4 of the present application includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and when the program or instruction is executed by the processor, a method in any one of the implementations in Embodiment 1 of the present application is implemented;
[0099] Among them, the processor can adopt a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits to execute relevant programs to implement the method in any one of the implementation methods in Example 1 of the present application.
[0100] The processor may also be an integrated circuit electronic device with signal processing capability. In the implementation process, each step of the method in any implementation of Embodiment 1 of the present application may be completed by an integrated logic circuit of hardware in the processor or by instructions in software form.
[0101] The above-mentioned processor may also be a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the functions required to be performed by the unit included in the data processing device of the embodiment of the present application in combination with its hardware, or executes the method in any one of the implementation modes in the embodiment 1 of the present application.
[0102] The above are only preferred specific implementations of the present application; however, the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution and its improved ideas of the present application within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A method for adjusting the peak factor of pink noise, characterized in that: include: S100, obtaining a pink noise signal; S200, calculating the effective value and peak factor of the pink noise signal; S300, determining whether the absolute value of the difference between the peak factor of the pink noise signal and the target peak factor is less than a preset threshold; If the judgment result is no, the effective value and amplitude of the pink noise signal are adjusted, and the process returns to step S200; If the judgment result is yes, a pink noise signal is output.
2. The method for adjusting the peak factor of pink noise according to claim 1, characterized in that: Calculating the effective value and the peak factor of the pink noise signal, including: Calculate the effective value of the pink noise signal: ; Among them, S 0rms is the effective value of the pink noise signal, S0 is the pink noise signal; Calculating the maximum value of the pink noise signal; Calculate the peak factor of the pink noise signal according to the effective value and the maximum value: ; Where cr0 is the peak factor of the pink noise signal, S 0max is the maximum value of the pink noise signal.
3. The method for adjusting the peak factor of pink noise according to claim 1, characterized in that: The effective value of the pink noise signal is adjusted, including: multiplying the pink noise signal by an adjustment constant, wherein an initial value of the adjustment constant is 1.0, and if the peak factor of the pink noise signal is greater than a target peak factor, increasing the adjustment constant; if the peak factor of the pink noise signal is less than the target peak factor, decreasing the adjustment constant.
4. The method for adjusting the peak factor of pink noise according to claim 1, characterized in that: The amplitude of the pink noise signal is adjusted, including: adjusting the amplitude of the pink noise signal by using an amplitude adjustment function, wherein the amplitude adjustment function is: ; Among them, S 0i represents an element in the pink noise signal, k is a constant, k corresponds to the adjustment factor of the adjustment function, S newi For element S 0i The element after being adjusted by the amplitude adjustment function.
5. A device for adjusting the peak factor of pink noise, characterized in that: include: An acquisition module, used for acquiring a pink noise signal; A calculation module, used for calculating the effective value and peak factor of the pink noise signal; An iteration module, used for determining whether the absolute value of the difference between the peak factor of the pink noise signal and the target peak factor is less than a preset threshold; If the judgment result is no, the effective value and amplitude of the pink noise signal are adjusted, and the process jumps to the calculation module; If the judgment result is yes, a pink noise signal is output.
6. The device for adjusting the peak factor of pink noise according to claim 5, characterized in that: The calculation module comprises: The first calculation submodule is used to calculate the effective value of the pink noise signal: ; Among them, S 0rms is the effective value of the pink noise signal, S0 is the pink noise signal; A second calculation submodule, used for calculating the maximum value of the pink noise signal; The third calculation submodule is used to calculate the peak factor of the pink noise signal according to the effective value and the maximum value: ; Where cr0 is the peak factor of the pink noise signal, S 0max is the maximum value of the pink noise signal.
7. The device for adjusting the peak factor of pink noise according to claim 5, characterized in that: The effective value of the pink noise signal is adjusted, including: multiplying the pink noise signal by an adjustment constant, wherein an initial value of the adjustment constant is 1.0, and if the peak factor of the pink noise signal is greater than a target peak factor, increasing the adjustment constant; if the peak factor of the pink noise signal is less than the target peak factor, decreasing the adjustment constant.
8. The device for adjusting the peak factor of pink noise according to claim 5, characterized in that: The amplitude of the pink noise signal is adjusted, including: adjusting the amplitude of the pink noise signal by using an amplitude adjustment function, wherein the amplitude adjustment function is: ; Among them, S 0i represents an element in the pink noise signal, k is a constant, k corresponds to the adjustment factor of the adjustment function, S newi For element S 0i The element after being adjusted by the amplitude adjustment function.
9. A signal testing method, characterized in that: The pink noise peak factor is adjusted by the method as described in any one of claims 1 to 4.
10. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction implements the method as claimed in any one of claims 1 to 4 when executed by the processor.
Citation Information
Patent Citations
Amplitude measurement method of sound signal, related equipment and readable storage medium
CN117198320A
Pink noise output method for inspected of acoustic apparatus
KR101757362B1
