Loudspeaker power adjustment method based on DSP and power amplifier and storage medium
Through the DSP and amplifier power adjustment method, the maximum amplification factor of the signal processor and the actual working parameters of the speaker are obtained, and the playback parameters of the hardware amplifier are set in combination with the rated working parameters of the speaker, which solves the problem of uncontrollable output power of the car speaker , realizes the controllability and playback effect of speaker output power.
Patent Information
- Application Number
- CN202411478119.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, the output power of the car horn is uncontrollable, which can easily lead to excessive output power damage to the horn.
Through the DSP and amplifier power adjustment method, the maximum amplification factor of the signal processor is obtained as the first adjustment parameter, the actual working parameters of the speaker are collected, and the playback parameters of the hardware amplifier are set according to the rated working parameters of the speaker to ensure the output power Below or less than the rated output power of the speaker.
It realizes controllability of the speaker output power, avoids the speaker damage caused by excessive output power, and ensures the playback effect.
Smart Images

Figure CN119485127A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multimedia playback, and in particular to a speaker power adjustment method based on DSP and power amplifier and a storage medium. Background Art
[0002] With the advent of the era of smart cars, the number and types of vehicle speakers are increasing, and different speakers have different power specifications.
[0003] The output power of a speaker usually refers to the nominal output power, also known as the rated power. It refers to the maximum output power that can be output for a long time without distortion. The maximum power refers to the maximum instantaneous power without damaging the appliance, that is, the maximum load capacity that the appliance can withstand.
[0004] The power of a car speaker is usually below 30W, and the power of a single speaker is between 20 and 30 watts. The power will double when dual speakers are configured. The rated power of the original designed speaker is between 40-60W, and the maximum power can reach 45W. The general car speaker outputs 25W at 4 ohms, and the maximum power is 45W. If it is replaced with a 6 ohm speaker, the output power will be reduced to 18W.
[0005] However, the speaker output power is uncontrollable during use by the user, so when its actual output power exceeds the maximum power of the speaker, it is easy to cause damage to the speaker. Summary of the invention
[0006] The present invention provides a speaker power adjustment method based on DSP and power amplifier and a storage medium, which solves the technical problems that the speaker output power is uncontrollable and the speaker is damaged due to excessive output power in the existing audio playback control.
[0007] In order to solve the above technical problems, the present invention provides a speaker power adjustment method based on DSP and power amplifier, comprising:
[0008] Acquire a test audio file, drive the signal processor to perform a speaker playback test based on the test audio file, and acquire a maximum amplification factor corresponding to the signal processor as a first adjustment parameter;
[0009] Collecting actual working parameters of the speaker under the control of the first adjustment parameter;
[0010] Acquire the rated operating parameters of the speaker, compare them with the actual operating parameters, set the playback parameters of the hardware amplifier according to the comparison result, and obtain the second adjustment parameters;
[0011] The hardware power amplifier is set with the second adjustment parameter, and the audio to be played is played based on the signal processor and the hardware power amplifier.
[0012] This basic solution is based on the uncontrollability of the signal processor (i.e. DSP) for the volume amplification factor. First, a speaker playback test is performed by testing an audio file to obtain the maximum amplification factor of the signal processor as the first adjustment parameter; then, based on the actual working parameters of the speaker under the control of the first adjustment parameter, a second adjustment parameter is set for the playback parameters caused by the construction; finally, the hardware amplifier is set with the second adjustment parameter, and the audio to be played is played based on the signal processor and the hardware amplifier. In this way, by setting the controllability of the volume amplification factor of the hardware amplifier and being compatible with the uncontrollability of the signal processor, the output power corresponding to the overall amplification factor of the system composed of "signal processor + hardware amplifier" is always lower than or less than the rated output power (rated working parameters) of the speaker, which can ensure the playback effect while protecting the normal operation of the speaker.
[0013] In a further embodiment, a test audio file is obtained, a signal processor is driven to perform a speaker playback test based on the test audio file, and a maximum amplification factor corresponding to the signal processor is obtained as a first adjustment parameter, including:
[0014] Select a standard 1Khz / 0dB sine wave source file as the test audio file and play it through the speaker;
[0015] Set the volume magnification of the hardware amplifier to 1, and do not magnify the audio volume;
[0016] The signal processor is driven to perform a volume amplification adjustment test on the test audio file;
[0017] The maximum magnification of the signal processor is obtained as a first adjustment parameter.
[0018] This solution sets the volume amplification factor of the hardware amplifier to 1, and does not perform any amplification processing on the audio volume, thereby avoiding interference with the independent test of the signal processor. Without increasing the test cost (no need to increase or reduce the original playback equipment, and directly test the playback equipment product itself), the accuracy of obtaining the maximum amplification factor of the signal processor is guaranteed.
[0019] In a further embodiment, the driving signal processor performs a volume amplification adjustment test on the test audio file, including:
[0020] A1, playing the test audio file based on the signal processor;
[0021] A2. Test whether the output power at both ends of the speaker reaches the maximum. If not, adjust upward based on the current amplification factor of the signal processor, increase the amplification factor of the signal processor and return to step A1; if so, obtain the current amplification factor of the signal processor as the maximum amplification factor corresponding to the signal processor.
[0022] This solution is based on the detection of the output power at both ends of the speaker to determine the maximum amplification factor of the signal processor. The judgment logic is simple and efficient.
[0023] In a further embodiment, the actual working parameters of the loudspeaker under the control of the first adjustment parameter are collected, specifically:
[0024] Playing the test audio file when the signal processor is set to a maximum amplification factor, at which time the output power at both ends of the test speaker is used as the actual working parameter corresponding to the first adjustment parameter;
[0025] The first adjustment parameter is the maximum amplification factor of the signal processor.
[0026] In a further embodiment, the rated operating parameters of the speaker are obtained, compared with the actual operating parameters, and the playback parameters of the hardware amplifier are set according to the comparison results to obtain the second adjustment parameters, including:
[0027] Obtaining the maximum rated power of the speaker as a rated operating parameter;
[0028] Comparing the actual working parameter with the rated working parameter, if the actual working parameter is greater than the rated working parameter, adjusting the playback parameter of the hardware power amplifier downward according to the rated working parameter; if the actual working parameter is less than the rated working parameter, adjusting the playback parameter of the hardware power amplifier upward according to the rated working parameter;
[0029] The playback parameters of the hardware amplifier are obtained to obtain the second adjustment parameters.
[0030] This solution collects the actual working parameters of the speaker corresponding to the first adjustment parameter, compares them with the maximum rated power, and preliminarily determines whether the adjustment range of the signal processor exceeds the rated power of the speaker, and then adjusts the playback parameters of the hardware power amplifier downward / upward according to the rated working parameters. The most suitable playback parameters of the hardware power amplifier are set based on the rated power of the speaker to ensure that the actual power usage of the speaker does not exceed the range and cause damage.
[0031] In a further embodiment, adjusting downward the playback parameters of the hardware amplifier according to the rated operating parameters includes:
[0032] B1. Setting the signal processor to operate under a first adjustment parameter, and identifying that the actual operating parameter is greater than the rated operating parameter;
[0033] B2, gradually reducing the volume amplification factor of the hardware power amplifier, and testing the output power at both ends of the speaker as the test output power;
[0034] B3, judging whether the test output power is equal to the rated working parameter, if so, recording the volume amplification factor of the current hardware amplifier as the playback parameter; if not, proceeding to step B4;
[0035] B4, determining whether the test output power is less than the rated operating parameter, if so, calculating the difference between the rated operating parameter and the test output power, if not, returning to step B2;
[0036] B5. Compare the difference to see whether it is less than a preset threshold value. If so, record the volume amplification factor of the current hardware amplifier as a playback parameter.
[0037] In a further embodiment, adjusting the playback parameters of the hardware amplifier upward according to the rated operating parameters includes:
[0038] C1. Setting the signal processor to operate under a first adjustment parameter, and identifying that the actual operating parameter is less than the rated operating parameter;
[0039] C2, gradually increasing the volume amplification factor of the hardware power amplifier, and testing the output power at both ends of the speaker as the test output power;
[0040] C3, judging whether the test output power is equal to the rated working parameter, if so, recording the volume amplification factor of the current hardware amplifier as the playback parameter; if not, proceeding to step C4;
[0041] C4, determining whether the test output power is less than the rated operating parameter, if so, calculating the difference between the rated operating parameter and the test output power, if not, returning to step C2;
[0042] C5. Compare whether the difference is less than a preset threshold value, and if so, record the volume amplification factor of the current hardware amplifier as a playback parameter.
[0043] When adjusting the amplification factor of the hardware power amplifier, this solution can be compatible with different types of signal processors through algorithm logic settings. Based on the refined step-by-step reduction / increase of the volume amplification factor of the hardware power amplifier, the fixed and controllable hardware adjustment (hardware power amplifier) is compatible with the uncontrollable software output control (signal processor), and the actual output power of the speaker can be protected without structural adjustments to the system itself.
[0044] The present invention also provides a storage medium on which a computer program is stored, and the computer program is used to implement the above-mentioned method for adjusting speaker power based on DSP and power amplifier. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM). BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 The present invention provides a flowchart of a method for adjusting speaker power based on DSP and power amplifier. DETAILED DESCRIPTION
[0046] The following specifically illustrates the implementation mode of the present invention in conjunction with the accompanying drawings. The embodiments are provided for illustrative purposes only and are not to be construed as limitations of the present invention. The accompanying drawings are provided for reference and illustration only and do not constitute limitations on the scope of patent protection of the present invention, because many changes may be made to the present invention without departing from the spirit and scope of the present invention.
[0047] Example 1
[0048] The embodiment of the present invention provides a speaker power adjustment method based on DSP and power amplifier, such as Figure 1 As shown, in this embodiment, steps S1 to S4 are included:
[0049] S1, obtaining a test audio file, driving a signal processor to perform a speaker playback test based on the test audio file, and obtaining a maximum amplification factor corresponding to the signal processor as a first adjustment parameter, including:
[0050] S11. Select a standard 1Khz / 0dB sine wave source file as the test audio file and play it through the speaker;
[0051] S12, setting the volume magnification of the hardware amplifier to 1, and not performing any amplification processing on the audio volume;
[0052] S13, driving the signal processor to perform a volume amplification adjustment test on the test audio file, including steps A1-A2:
[0053] A1, playing the test audio file based on the signal processor;
[0054] A2. Test whether the output power at both ends of the speaker reaches the maximum. If not, adjust upward based on the current amplification factor of the signal processor, increase the amplification factor of the signal processor and return to step A1; if so, obtain the current amplification factor of the signal processor as the maximum amplification factor corresponding to the signal processor.
[0055] This embodiment realizes the judgment of the maximum amplification factor of the signal processor based on the detection of the output power at both ends of the speaker, and the judgment logic is simple and efficient.
[0056] S14. Obtain the maximum amplification factor Dmax corresponding to the signal processor as the first adjustment parameter.
[0057] That is, the amplification factor of the signal processor is between 0 and Dmax.
[0058] In this embodiment, the volume amplification factor of the hardware power amplifier is set to 1, and no amplification factor processing is performed on the audio volume, so as to avoid interfering with the independent test of the signal processor. Without increasing the test cost (without adding or reducing the original playback device and directly testing the playback device product itself), the accuracy of obtaining the maximum amplification factor of the signal processor is guaranteed.
[0059] S2. Collect the actual working parameters of the speaker under the control of the first adjustment parameter, specifically:
[0060] When the signal processor is set to the maximum amplification factor Dmax, play the test audio file. At this time, the output power Wa at both ends of the test speaker is used as the actual working parameter corresponding to the first adjustment parameter;
[0061] The first adjustment parameter is the maximum amplification factor of the signal processor.
[0062] S3. Obtain the rated working parameters of the speaker, compare them with the actual working parameters, and set the playback parameters of the hardware power amplifier according to the comparison result to obtain the second adjustment parameter, including steps S31 to S33;
[0063] S31. Obtain the maximum rated power of the speaker as the rated working parameter Wmax;
[0064] S32. Compare the actual working parameter with the rated working parameter. If the actual working parameter is greater than the rated working parameter (Wa > Wmax), then adjust the playback parameter of the hardware power amplifier downward according to the rated working parameter; if the actual working parameter is less than the rated working parameter (Wa < Wmax), then adjust the playback parameter of the hardware power amplifier upward according to the rated working parameter;
[0065] Among them, the hardware power amplifier is a power amplifier chip, which is a conventional technology in this field and will not be elaborated in this embodiment.
[0066] In this embodiment, adjusting the playback parameter of the hardware power amplifier downward according to the rated working parameter includes steps B1 to B5:
[0067] B1. Set the signal processor to work under the first adjustment parameter, and it is recognized that the actual operating parameter is greater than the rated operating parameter;
[0068] B2. Gradually decrease the volume amplification factor of the hardware power amplifier, and at the same time test the output power across the speaker as the test output power Wb;
[0069] B3. Determine whether the test output power is equal to the rated operating parameter. If so, record the current volume amplification factor of the hardware power amplifier as the playback parameter (i.e., Wb = Wmax); if not, go to step B4;
[0070] B4. Determine whether the test output power is less than the rated operating parameter. If so, calculate the difference between the rated operating parameter and the test output power (i.e., Wb < Wmax); if not, return to step B2;
[0071] B5. Compare whether the difference is less than the preset threshold. If so, record the current volume amplification factor of the hardware power amplifier as the playback parameter D.
[0072] In this embodiment, when adjusting the playback parameter of the hardware power amplifier according to the rated operating parameter, it includes steps C1 - C5:
[0073] C1. Set the signal processor to work under the first adjustment parameter, and it is recognized that the actual operating parameter is less than the rated operating parameter;
[0074] C2. Gradually increase the volume amplification factor of the hardware power amplifier, and at the same time test the output power across the speaker as the test output power;
[0075] C3. Determine whether the test output power is equal to the rated operating parameter. If so, record the current volume amplification factor of the hardware power amplifier as the playback parameter; if not, go to step C4;
[0076] C4. Determine whether the test output power is less than the rated operating parameter. If so, calculate the difference between the rated operating parameter and the test output power; if not, return to step C2;
[0077] C5. Compare whether the difference is less than the preset threshold. If so, record the current volume amplification factor of the hardware power amplifier as the playback parameter D.
[0078] In this embodiment, when adjusting the amplification factor of the hardware power amplifier, through algorithm logic setting, it can be compatible with different types of signal processors. Based on the refined gradual decrease / increase of the volume amplification factor of the hardware power amplifier, the fixed and controllable hardware adjustment (hardware power amplifier) is used to be compatible with the uncontrollable software output control (signal processor). Without adjusting the structure of the system itself, it can achieve the protection of the actual output power of the speaker.
[0079] S33: Acquire the playback parameters of the hardware power amplifier to obtain the second adjustment parameter.
[0080] This embodiment collects the actual working parameters of the speaker corresponding to the first adjustment parameter, compares them with the maximum rated power, and preliminarily determines whether the adjustment range of the signal processor exceeds the rated power of the speaker, and then adjusts the playback parameters of the hardware power amplifier downward / upward according to the rated working parameters, and sets the most suitable playback parameters of the hardware power amplifier based on the rated power of the speaker to ensure that the actual power usage of the speaker does not exceed the range and cause damage.
[0081] S4. Setting the hardware power amplifier with the second adjustment parameter, and playing the audio to be played based on the signal processor and the hardware power amplifier.
[0082] The hardware amplifier's amplification factor is set to a fixed D, and the user adjusts the volume value to the DSP's amplification factor (0~Dmax). The maximum output power that can be achieved by the adjusted DSP amplification factor is Wb, which is less than or equal to the speaker's maximum output power Wmax, which can protect the speaker from working within the rated output power.
[0083] The embodiment of the present invention is based on the uncontrollability of the volume amplification factor of the signal processor (i.e., DSP). First, a speaker playback test is performed by testing an audio file to obtain the maximum amplification factor of the signal processor as a first adjustment parameter; then, based on the actual working parameters of the speaker under the control of the first adjustment parameter, a second adjustment parameter is set for the playback parameters caused by the construction; finally, the hardware power amplifier is set with the second adjustment parameter, and the audio to be played is played based on the signal processor and the hardware power amplifier. In this way, by setting the controllability of the volume amplification factor of the hardware power amplifier, the uncontrollability of the signal processor is compatible, so that the output power corresponding to the overall amplification factor of the system composed of "signal processor + hardware power amplifier" is always lower than or less than the rated output power (rated working parameters) of the speaker, which can ensure the playback effect while protecting the normal operation of the speaker.
[0084] Example 2
[0085] The embodiment of the present invention further provides a storage medium on which a computer program is stored, and the computer program is used to implement a speaker power adjustment method based on DSP and power amplifier as described in the above embodiment 1. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0086] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A speaker power adjustment method based on DSP and power amplifier, characterized in that: include: Acquire a test audio file, drive the signal processor to perform a speaker playback test based on the test audio file, and acquire a maximum amplification factor corresponding to the signal processor as a first adjustment parameter; Collecting actual working parameters of the speaker under the control of the first adjustment parameter; Acquire the rated operating parameters of the speaker, compare them with the actual operating parameters, set the playback parameters of the hardware amplifier according to the comparison result, and obtain the second adjustment parameters; The hardware power amplifier is set with the second adjustment parameter, and the audio to be played is played based on the signal processor and the hardware power amplifier.
2. A method for adjusting speaker power based on DSP and power amplifier as claimed in claim 1, characterized in that: Acquire a test audio file, drive a signal processor to perform a speaker playback test based on the test audio file, and acquire a maximum amplification factor corresponding to the signal processor as a first adjustment parameter, including: Select a standard 1Khz / 0dB sine wave source file as the test audio file and play it through the speaker; Set the volume magnification of the hardware amplifier to 1, and do not magnify the audio volume; The signal processor is driven to perform a volume amplification adjustment test on the test audio file; The maximum magnification of the signal processor is obtained as a first adjustment parameter.
3. A speaker power adjustment method based on DSP and power amplifier as claimed in claim 2, characterized in that: The driving signal processor performs a volume amplification adjustment test on the test audio file, including: A1, playing the test audio file based on the signal processor; A2. Test whether the output power at both ends of the speaker reaches the maximum. If not, adjust upward based on the current amplification factor of the signal processor, increase the amplification factor of the signal processor and return to step A1; if so, obtain the current amplification factor of the signal processor as the maximum amplification factor corresponding to the signal processor.
4. A method for adjusting speaker power based on DSP and power amplifier as claimed in claim 3, characterized in that: The actual working parameters of the collection speaker under the control of the first adjustment parameter are specifically: Playing the test audio file when the signal processor is set to a maximum amplification factor, at which time the output power at both ends of the test speaker is used as the actual working parameter corresponding to the first adjustment parameter; The first adjustment parameter is the maximum amplification factor of the signal processor.
5. A method for adjusting speaker power based on DSP and power amplifier as claimed in claim 4, characterized in that: Acquiring the rated operating parameters of the speaker, comparing them with the actual operating parameters, and setting the playback parameters of the hardware amplifier according to the comparison results to obtain the second adjustment parameters, including: Obtaining the maximum rated power of the speaker as a rated operating parameter; Comparing the actual operating parameter with the rated operating parameter, if the actual operating parameter is greater than the rated operating parameter, adjusting the playback parameter of the hardware power amplifier downward according to the rated operating parameter; If the actual operating parameter is less than the rated operating parameter, adjusting the playback parameter of the hardware power amplifier upward according to the rated operating parameter; The playback parameters of the hardware amplifier are obtained to obtain the second adjustment parameters.
6. A method for adjusting speaker power based on DSP and power amplifier as claimed in claim 5, characterized in that: Adjusting the playback parameters of the hardware amplifier downward according to the rated operating parameters includes: B1. Setting the signal processor to operate under a first adjustment parameter, and identifying that the actual operating parameter is greater than the rated operating parameter; B2, gradually reducing the volume amplification factor of the hardware power amplifier, and testing the output power at both ends of the speaker as the test output power; B3, judging whether the test output power is equal to the rated working parameter, if so, recording the volume amplification factor of the current hardware amplifier as the playback parameter; if not, proceeding to step B4; B4, determining whether the test output power is less than the rated operating parameter, if so, calculating the difference between the rated operating parameter and the test output power, if not, returning to step B2; B5. Compare the difference to see whether it is less than a preset threshold value. If so, record the volume amplification factor of the current hardware amplifier as a playback parameter.
7. A method for adjusting speaker power based on DSP and power amplifier as claimed in claim 5, characterized in that: Adjusting the playback parameters of the hardware amplifier upward according to the rated operating parameters includes: C1. Setting the signal processor to operate under a first adjustment parameter, and identifying that the actual operating parameter is less than the rated operating parameter; C2, gradually increasing the volume amplification factor of the hardware power amplifier, and testing the output power at both ends of the speaker as the test output power; C3, judging whether the test output power is equal to the rated working parameter, if so, recording the volume amplification factor of the current hardware amplifier as the playback parameter; if not, proceeding to step C4; C4, determining whether the test output power is less than the rated operating parameter, if so, calculating the difference between the rated operating parameter and the test output power, if not, returning to step C2; C5. Compare whether the difference is less than a preset threshold value, and if so, record the volume amplification factor of the current hardware amplifier as a playback parameter.
8. A storage medium having a computer program stored thereon, characterized in that: The computer program is used to implement a speaker power adjustment method based on DSP and power amplifier as described in any one of claims 1-7.
Citation Information
Cited By
Loudspeaker power self-adaption system, method and device and electronic equipment
CN120848211A