Multi-phase pulse width modulation method for reducing harmonics of class-d power amplifier and related device
By using a multiphase pulse width modulation method, the phase difference is used to cancel high-frequency carrier harmonics, thus solving the problem of harmonic distortion in Class D power amplifiers. This achieves efficient harmonic suppression and audio quality improvement, and is applicable to different hardware platforms.
Patent Information
- Application Number
- CN202511323837.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2045-09-17
AI Technical Summary
Traditional Class D power amplifiers suffer from high harmonic distortion during pulse width modulation, which affects audio quality.
The method employs multiphase pulse width modulation (MPM) to generate multiple triangular wave signals with the same phase difference and uniform distribution. These signals are then compared with the amplitude of a sinusoidal audio signal to generate multiple pulse width modulation signals, which are then superimposed. Finally, the superimposed signal is input into a Class D power amplifier, where the phase difference is used to cancel high-frequency carrier harmonics and reduce harmonic distortion.
Without increasing filter cost and complexity, it significantly reduces harmonic distortion of Class D power amplifiers, improves audio fidelity, and has adaptability and self-optimization capabilities for different hardware platforms.
Smart Images

Figure CN120825154B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of broadcast television, and particularly relates to a multi-phase pulse width modulation method for reducing harmonics of a class-D power amplifier and related equipment. BACKGROUND
[0002] With the rapid development of digital information technology, the performance of audio power amplifiers in the fields of consumer electronics, car audio, professional audio, and portable smart devices has become increasingly demanding. Among the many amplifier technologies, class-D power amplifiers have become the mainstream choice for modern audio systems due to their excellent theoretical efficiency (approaching 100%), extremely low power loss and heat generation, and high potential for integration. The core working principle is not linear amplification, but to convert the input analog or digital audio stream into a high-frequency pulse width modulation (PWM) signal. This high-frequency pulse signal is used to control the power switch tube (such as MOSFET) to switch between fully on and fully off at high speed, thereby driving the loudspeaker and other loads. Since the on-resistance of the switch tube is zero and the off-resistance is infinite in the ideal state, its own power consumption is extremely low, which is the fundamental source of high efficiency of class-D power amplifiers. This working mode makes class-D power amplifiers particularly suitable for scenarios with strict limitations on power consumption and heat dissipation, such as smartphones, wireless speakers, and audio systems for new energy vehicles.
[0003] In related technologies, the pulse width modulation device generally generates a high-frequency carrier signal at a fixed frequency much higher than the highest frequency of the audio signal (usually 20 kHz). The waveform of this carrier signal is usually a standard isosceles triangle wave or sawtooth wave. At the same time, after sampling and processing the input original audio signal, its instantaneous amplitude is compared with the instantaneous amplitude of the high-frequency triangle wave carrier at each sampling time. When the audio signal amplitude is higher than the triangle wave amplitude, the comparator outputs a high level; otherwise, it outputs a low level. Through this continuous comparison, the system generates a series of pulses whose width varies with the amplitude of the audio signal, i.e., a standard pulse width modulation (PWM) signal. This single PWM signal stream is then directly used to drive the output stage power tube of the class-D power amplifier, and after power amplification, the high-frequency carrier component is filtered out by a low-pass filter (LPF), and finally the amplified audio signal is restored on the loudspeaker.
[0004] However, the pulse width modulation process of the related art itself has inherent nonlinear elements, especially when driving actual power switch tubes, in order to prevent the simultaneous conduction of the upper and lower tubes of the bridge arm, causing a short circuit, a dead time must be set. During the dead time, the output end is in a high resistance state, which causes a deviation between the final generated pulse width and the ideal width determined by the audio amplitude in theory. The size of this deviation is related to the instantaneous polarity and rate of change of the audio signal, and is a typical source of nonlinear distortion. This nonlinear effect directly acts on the modulated audio signal, thereby generating harmonic components of the original audio signal in the audio frequency band (20Hz-20kHz). Once these harmonic distortions are generated, they are mixed with the useful audio signal and cannot be filtered out by the low-pass filter in the later stage, and are ultimately directly reflected in the output signal of the power amplifier, causing the total harmonic distortion index to deteriorate, and the sound roughness and resolution to decrease in listening. SUMMARY
[0005] The present application provides a multi-phase pulse width modulation method for reducing harmonics of a class-D power amplifier and related equipment, which is used to solve the problem that the traditional pulse width modulation PWM signal usually has high harmonic distortion, thereby affecting the audio quality of the output of the class-D power amplifier.
[0006] In a first aspect, the present application provides a multi-phase pulse width modulation method for reducing harmonics of a class-D power amplifier, applied to a multi-phase pulse width modulation device, the method comprising:
[0007] sampling an original audio signal at a preset sampling rate to obtain a sinusoidal audio signal;
[0008] generating a plurality of triangular wave signals corresponding to the sinusoidal audio signal at a preset frequency multiple, the phase difference between adjacent triangular wave signals being the same, and the sum of the phase differences of all adjacent triangular wave signals being equal to 360°, the rising edge slope of the triangular wave signal being equal in absolute value to the falling edge slope;
[0009] comparing the sinusoidal audio signal with each triangular wave signal in amplitude to obtain a pulse width modulation signal corresponding to each triangular wave signal;
[0010] superimposing a plurality of pulse width modulation signals to obtain a superimposed signal;
[0011] inputting the superimposed signal into a class-D power amplifier to obtain a power amplifier output signal with reduced harmonics.
[0012] Through the above embodiment, the multi-phase pulse width modulation device adopts multiple adjacent triangular waves with the same phase difference and uniformly distributed as carriers. When the same sinusoidal audio signal is compared with these triangular waves with phase gradient in amplitude, multiple pulse width modulation (PWM) signals are generated. Although each independent PWM signal still contains the carrier frequency and its harmonics, these harmonic components also correspondingly inherit the phase difference of the carrier. In the final superposition step, since the useful audio components in all PWM signals are in phase, they are superimposed in phase to obtain enhancement; while the high-frequency carrier harmonic components interfere and cancel each other due to their uniformly distributed phase difference, so that the main harmonic energy in the final superposition signal is pushed to the integer multiple (N times, N is the number of phases) of the original carrier frequency, and the fundamental carrier and harmonics are significantly weakened. This method makes the superposition signal "purify" the frequency spectrum of the modulation signal before entering the class-D power amplifier, reducing the performance requirements of the low-pass filter in the later stage, thereby realizing the suppression of harmonic distortion of the output signal without increasing the cost and complexity of the filter.
[0013] In some embodiments, the step of generating multiple triangular wave signals corresponding to the sinusoidal audio signal at a preset frequency multiple, specifically includes:
[0014] Obtaining the rated power of the class-D power amplifier;
[0015] Matching the initial number of triangular wave signals corresponding to the rated power based on a preset mapping relationship table, the rated power is positively correlated with the initial number;
[0016] Calculating the phase difference between adjacent triangular wave signals according to the initial number;
[0017] Generating multiple triangular wave signals corresponding to the sinusoidal audio signal according to the preset frequency multiple and the phase difference.
[0018] Through the above embodiment, considering that the rated power of the power amplifier is usually positively correlated with its output capacity and internal topology complexity, high-power power amplifiers are more likely to produce distortion. The multi-phase pulse width modulation device takes the rated power of the class-D power amplifier as an input parameter, and through a preset mapping relationship table, directly associates the rated power with the initial number of triangular wave signals, automatically configuring more modulation phases for power amplifiers with higher rated power. Once the initial number is determined, the system can accurately calculate the phase difference (360° / initial number) required to achieve the best harmonic cancellation effect. This method makes the harmonic suppression scheme adaptable to different hardware platforms, and can configure fewer phases for low-power and low-cost power amplifiers to save computing resources, while configuring more phases for high-power and high-performance power amplifiers to achieve stronger harmonic suppression effect.
[0019] In some embodiments, the step of generating a plurality of triangular wave signals corresponding to the sinusoidal wave audio signal according to the preset frequency multiple and the phase difference specifically comprises:
[0020] Real-time monitoring the sinusoidal wave audio signal to obtain an instantaneous amplitude;
[0021] Mapping the instantaneous amplitude to a shape adjustment coefficient based on a preset nonlinear mapping relationship;
[0022] Configuring an independent digital accumulator for each triangular wave signal to be generated, and setting a different initial phase value for each digital accumulator according to the phase difference;
[0023] Linearly increasing or decreasing the digital accumulator by a preset step size to obtain rising and falling edges of a standard triangular wave, wherein the preset step size is determined according to the preset frequency multiple;
[0024] When the count value of the digital accumulator enters a preset peak threshold range, using the shape adjustment coefficient to reduce the preset step size to obtain a variable step size;
[0025] Continuing to increase or decrease the digital accumulator using the variable step size to generate a peak region of the triangular wave signal;
[0026] According to the rising edge, the falling edge and the peak region, a plurality of triangular wave signals are constructed.
[0027] Through the above embodiments, the multi-phase pulse width modulation device obtains a shape adjustment coefficient through real-time monitoring of the instantaneous amplitude of the sinusoidal wave audio signal and a nonlinear mapping relationship. When the digital accumulator used to generate the triangular wave is close to the peak region (i.e., the region where the PWM duty cycle is close to 0% or 100%, which is most susceptible to the effects of dead time and other nonlinear effects), the shape adjustment coefficient is used to reduce the preset generation step size. This operation makes the peak region of the triangular wave no longer a sharp linear turning point, but relatively smooth. By actively changing the carrier shape, the subsequent power stage-induced pulse width distortion caused by dead time and other factors is offset in advance, especially when large signal output is used. This is equivalent to a second, more targeted suppression at the root of harmonic generation, which complements the multi-phase cancellation technology and works together to further reduce total harmonic distortion and improve the audio fidelity of the class-D power amplifier.
[0028] In some embodiments, after the step of superimposing a plurality of the pulse width modulation signals to obtain a superimposed signal, further comprising:
[0029] Constructing a multi-phase PWM spectrum diagram according to the superimposed signal;
[0030] acquiring a target amplitude of a highest point of a harmonic closest to a frequency corresponding to the sinusoidal audio signal in the multi-phase PWM spectrum diagram;
[0031] If the target amplitude is greater than or equal to a preset ideal amplitude, increasing an initial number of the triangular wave signals corresponding to the rated power to obtain a new superimposed signal.
[0032] Through the above embodiments, the multi-phase pulse width modulation device constructs its multi-phase PWM spectrum diagram after generating the superimposed signal, acquires a target amplitude of a highest point of a harmonic closest to a frequency corresponding to the audio signal in the spectrum diagram, compares the actual measured amplitude with a preset ideal amplitude, and triggers a feedback operation if the actual harmonic amplitude exceeds the ideal amplitude, i.e., is greater than or equal to the ideal amplitude, i.e., increases the initial number of the triangular wave signals and generates a new superimposed signal for reevaluation. This method enables the multi-phase modulation device to no longer rely on static configuration before leaving the factory, but to actively compensate for performance degradation possibly introduced by temperature drift, component aging, etc. according to real signal performance for self-optimization and calibration during actual operation.
[0033] In some embodiments, the step of comparing the sinusoidal audio signal with each of the triangular wave signals in amplitude to obtain a pulse width modulation signal corresponding to each of the triangular wave signals specifically includes:
[0034] comparing a first instantaneous amplitude of the sinusoidal audio signal with a second instantaneous amplitude of a corresponding one of the triangular wave signals at each sampling time;
[0035] If the first instantaneous amplitude of the sinusoidal audio signal is greater than the second instantaneous amplitude of the triangular wave signal, an output of the pulse width modulation signal at the current sampling time is a first preset level representing a first logic state;
[0036] If the first instantaneous amplitude of the sinusoidal audio signal is less than or equal to the second instantaneous amplitude of the triangular wave signal, the output of the pulse width modulation signal at the current sampling time is a second preset level representing a second logic state.
[0037] Through the above embodiments, the multi-phase pulse width modulation device compares a first instantaneous amplitude of the sinusoidal audio signal with a second instantaneous amplitude of a corresponding triangular wave signal. When the audio amplitude is greater than the triangular wave amplitude, a first preset level representing a first logic state (e.g., a digital '1' or a high level) is output; otherwise, a second preset level representing a second logic state (e.g., a digital '0' or a low level) is output, thereby converting the sampling signal into a pulse width modulation signal.
[0038] In some embodiments, the step of superimposing a plurality of the pulse width modulation signals to obtain a superimposed signal specifically includes:
[0039] The plurality of pulse width modulation signals are divided into at least two signal subsets based on a preset interleaving sequence rule, and the number of pulse width modulation signals in each signal subset is the same.
[0040] The pulse width modulation signals in each signal subset are respectively superimposed to generate at least two superimposed signals.
[0041] Through the above embodiment, after obtaining a plurality of pulse width modulation (PWM) signals, the multi-phase pulse width modulation device divides them into at least two signal subsets with the same number according to a preset interleaving sequence rule. For example, the PWM signals of odd phases can be divided into a group, and the PWM signals of even phases can be divided into another group. Then, the PWM signals in each subset are respectively superimposed to generate at least two independent superimposed signals. This method makes each independent superimposed signal generated by the device can be used to accurately drive a power unit in a class-D power amplifier, and the multi-phase harmonic cancellation advantage in the signal domain is seamlessly extended to the power domain, so that different power units of the power amplifier can work in an interleaved manner, thereby realizing further cancellation of output current ripple, improving power conversion efficiency, and reducing the demand for an output filter.
[0042] In some embodiments, the step of inputting the superimposed signals into a class-D power amplifier to obtain a harmonic-reduced power amplifier output signal specifically includes:
[0043] Each superimposed signal is respectively input into a corresponding power amplifier module group.
[0044] The power output signals of a plurality of power amplifier module groups are synthesized, and the synthesized power output signals are low-pass filtered to obtain a harmonic-reduced power amplifier output signal.
[0045] Through the above embodiment, the multi-phase pulse width modulation device respectively inputs independent superimposed signals into corresponding power amplifier module groups. After receiving the corresponding superimposed signals, each power amplifier module group independently performs power amplification to generate a respective power output signal. Finally, the power output signals from different power amplifier module groups are synthesized and uniformly low-pass filtered to obtain a final audio output. This method not only realizes multi-phase harmonic cancellation, but also brings the equalization of power device current stress, the optimization of heat dissipation, and the reduction of output current ripple.
[0046] In a second aspect, the application provides a multi-phase pulse width modulation device, which comprises one or more processors and a memory.
[0047] The memory is coupled with the one or more processors, and is configured to store computer program codes, the computer program codes comprising computer instructions, which are invoked by the one or more processors to enable the multi-phase pulse width modulation device to implement the multi-phase pulse width modulation method for reducing harmonics of a class-D power amplifier provided in the above embodiments, which are not repeated here.
[0048] In a third aspect, the present application provides a computer readable storage medium, comprising instructions, which, when executed on a multi-phase pulse width modulation device, enable the multi-phase pulse width modulation device to implement the multi-phase pulse width modulation method for reducing harmonics of a class-D power amplifier provided in the above embodiments, which are not repeated here.
[0049] In a fourth aspect, the present application provides a computer program product, which, when executed on a multi-phase pulse width modulation device, enables the multi-phase pulse width modulation device to implement the multi-phase pulse width modulation method for reducing harmonics of a class-D power amplifier provided in the above embodiments, which are not repeated here.
[0050] The one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0051] 1. By generating a set of phase-accurate stepped (sum of 360°) triangular wave carrier arrays, a single modulation process is decomposed into parallel multi-channel modulation. When these pulse width modulation signals carrying phase information are finally superimposed, the in-phase useful audio signals are linearly enhanced, while the out-of-phase high-frequency carrier harmonics are greatly suppressed due to the effect of destructive interference. This architecture further extends the signal domain harmonic cancellation advantage to the power domain by accurately driving the physical topology of the multi-module power amplifier, thereby fundamentally reducing the harmonic distortion problem of the class-D power amplifier without relying on complex high-order filters.
[0052] 2. A mapping relationship between the rated power of the power amplifier and the initial number of triangular waves is established to achieve intelligent resource allocation based on hardware capabilities. A closed-loop feedback system is introduced in the dynamic running stage to compare the measured harmonic amplitude with the ideal target by real-time analysis of the frequency spectrum of the superimposed signal, and automatically adjust the number of phases accordingly. The multi-phase pulse width modulation device has adaptability to different hardware platforms and self-healing ability to changes in running time, ensuring the robustness and optimality of the harmonic suppression effect.
[0053] 3. By monitoring the instantaneous amplitude of the audio signal in real time, the shape of the peak region of the triangular wave carrier is dynamically adjusted from "sharp" to "smooth". This dynamic adjustment of the carrier is essentially a pre-compensation that counteracts the impending pulse width nonlinear distortion in the power stage. This technique, combined with the multi-phase harmonic cancellation technique, provides double protection, deeply suppressing distortion from two different dimensions (frequency domain cancellation and time domain compensation), and synergistically achieving extremely high audio fidelity. BRIEF DESCRIPTION OF DRAWINGS
[0054] Figure 1 is a flowchart of a multi-phase pulse width modulation method for reducing harmonics of a class-D power amplifier in an embodiment of the present application;
[0055] Figure 2 is another flowchart of a multi-phase pulse width modulation method for reducing harmonics of a class-D power amplifier in an embodiment of the present application;
[0056] Figure 3 is an exemplary scenario diagram of a single-phase PWM modulation used in the related art;
[0057] Figure 4 is an exemplary scenario diagram of three-phase PWM modulation used by a multi-phase pulse width modulation device in an embodiment of the present application;
[0058] Figure 5 is an exemplary scenario diagram of six-phase PWM modulation used by a multi-phase pulse width modulation device in an embodiment of the present application;
[0059] Figure 6 is a schematic diagram of an entity device structure of a multi-phase pulse width modulation device in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and the appended claims of the present application, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to any or all possible combinations of one or more of the associated listed items.
[0061] Hereinafter, the terms "first" and "second" are used only for the purpose of description and should not be construed as implying or suggesting relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined with "first" and "second" can explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise specified.
[0062] For the convenience of understanding, the method provided in the present embodiment is described in a flow. Please refer to Figure 1 A flowchart of a multi-phase pulse width modulation method for reducing harmonics of a class-D power amplifier in an embodiment of the present application.
[0063] S101, sample the original audio signal at a preset sampling rate to obtain a sinusoidal audio signal.
[0064] The preset sampling rate refers to the frequency of discretely sampling the original audio signal, which usually needs to meet the Nyquist sampling theorem (not less than 2 times the highest frequency of the audio signal, such as 44.1 kHz, 48 kHz, etc.), and in the present embodiment, the preset sampling rate is 2 MHz. The original audio signal refers to an input audio signal that has not been processed, which can come from a microphone, a music file, etc., and is usually a continuous analog signal. The sinusoidal audio signal refers to a digital audio signal that presents a sinusoidal characteristic after sampling and processing, which can approximate the waveform characteristics of the original audio signal.
[0065] Specifically, the multi-phase pulse width modulation device acquires an externally input original analog audio signal, and then periodically samples it at a preset sampling rate. Through sampling, the continuous original audio signal is converted into a discrete digital sample sequence, and each sample corresponds to the signal amplitude at a certain time. Since the original audio signal can usually be decomposed into the superposition of multiple sinusoidal waves, after sampling and basic filtering processing, the final digital signal presents a sinusoidal audio signal.
[0066] Optionally, the multi-phase pulse width modulation device receives the original analog audio signal through a built-in analog-to-digital converter (ADC); the ADC samples the analog signal at a preset sampling rate and outputs discrete digital samples; the digital samples pass through a low-pass filter to remove high-frequency noise, and finally generate a sinusoidal audio signal.
[0067] Optionally, an external audio source transmits an original digital audio signal to the device through a digital interface (such as I2S); the device resamples the digital signal and adjusts it to a preset sampling rate; the digital signal is decomposed into sinusoidal components through Fourier transform, and the main sinusoidal component is extracted as a sinusoidal audio signal.
[0068] It can be understood that other ways can also be used to realize sampling and conversion, such as generating a sinusoidal wave through a software algorithm to fit the sampling data, which is not limited here.
[0069] S102, generate a plurality of triangular wave signals corresponding to the sinusoidal audio signal at a preset frequency multiple.
[0070] The preset frequency multiple refers to a ratio of a frequency of the triangular wave signal to a highest frequency of the sine wave audio signal, and the preset frequency multiple is 10 in the embodiment of the application; the triangular wave signal refers to a periodic signal with a triangular waveform, which is composed of a rising edge, a falling edge and a peak top / valley, and is used as a carrier signal of pulse width modulation; the phase difference refers to a phase difference value of two adjacent triangular wave signals at the same time, and since the phases are uniformly distributed, a single phase difference is 360° divided by the number of triangular waves; the rising edge slope refers to a change rate in a process in which the triangular wave signal rises from a valley value to a peak value; and the falling edge slope refers to a change rate in a process in which the triangular wave signal falls from the peak value to the valley value, and an absolute value of the falling edge slope is equal to the rising edge slope, thereby ensuring symmetry of the triangular wave.
[0071] Specifically, the multiphase pulse width modulation device determines the frequency of the triangular wave according to the preset frequency multiple, and then generates a plurality of triangular wave signals, the frequencies of the triangular waves being the same, but the phases being sequentially staggered, the adjacent phase differences being uniform (for example, the phase difference is 120° for 3 triangular waves), and the sum of all phase differences being 360°, thereby forming a complete phase period. Meanwhile, the absolute values of the rising edge and falling edge slopes of each triangular wave are equal, thereby ensuring symmetry of the waveform and avoiding introduction of additional distortion due to asymmetry of the waveform.
[0072] S103, comparing the sampling signal with each triangular wave signal in amplitude to obtain a pulse width modulation signal corresponding to each triangular wave signal.
[0073] The pulse width modulation signal (PWM signal) refers to a digital signal with a fixed amplitude and a pulse width varying with the amplitude of the audio signal, and a duty ratio of a high level and a low level reflects amplitude information of the audio signal.
[0074] Specifically, the multiphase pulse width modulation device synchronously acquires an instantaneous amplitude (a first instantaneous amplitude) of the sine wave audio signal and an instantaneous amplitude (a second instantaneous amplitude) of each triangular wave signal at each sampling time. Then, the two are compared one by one: when the first instantaneous amplitude is greater than the second instantaneous amplitude, a high level (a first preset level) is output; and when the first instantaneous amplitude is less than or equal to the second instantaneous amplitude, a low level (a second preset level) is output. Through continuous real-time comparison, a string of pulse width modulation signals with a pulse width varying with the audio signal is generated for each triangular wave, and the greater the amplitude of the audio signal, the higher the duty ratio of the high level of the PWM signal, thereby encoding the audio information into the pulse width.
[0075] Optionally, the multiphase pulse width modulation device inputs the sine wave audio signal (analog or digital) and the triangular wave signal into a comparator through a comparator hardware circuit; the comparator outputs a high or low level (based on the amplitude) at each time, thereby forming a preliminary PWM signal; and the preliminary PWM signal is shaped to output the pulse width modulation signal corresponding to each triangular wave after removing burrs.
[0076] Optionally, at the software level, the instantaneous amplitude data of the sine wave and the triangular wave are read synchronously at the sampling time; comparison logic is written to determine the amplitude and output the corresponding logic level (1 or 0); and the logic level sequence is converted into a pulse signal recognizable by hardware to generate a pulse width modulation signal.
[0077] It can be understood that other ways can also be used for implementation, such as using a dedicated PWM modulation chip to complete the comparison, which is not limited here.
[0078] S104, superimposing the plurality of pulse width modulation signals to obtain a superimposed signal.
[0079] Specifically, the multi-phase pulse width modulation device superimposes the plurality of generated PWM signals. Since each PWM signal carries the same audio information (in phase), but the high-frequency carrier harmonics present different phases due to the phase difference of the triangular wave, the in-phase audio useful components are linearly enhanced when superimposed, and the out-of-phase high-frequency harmonics are mutually canceled due to destructive interference. In the superimposed signal, the harmonic components in the audio frequency band are greatly reduced, and the high-frequency carrier energy is pushed to a higher frequency, which is convenient for subsequent filtering processing, and provides a more "pure" modulation signal for the input class-D power amplifier.
[0080] Optionally, in three-phase PWM modulation, if the three pulse width modulation signals are all "1" at a certain time, the superimposed signal at that time is "3"; if the three pulse width modulation signals are "1", "1", and "0" at a certain time, the superimposed signal at that time is "2".
[0081] S105, inputting the superimposed signal into a class-D power amplifier to obtain a power amplifier output signal with reduced harmonics.
[0082] The low-pass filter refers to a process of allowing low-frequency signals (audio signals, 20Hz-20kHz) to pass through the filter and suppressing high-frequency signals (carrier and harmonics); the class-D power amplifier refers to an amplifier that realizes power amplification through high-speed switching of power switching tubes (such as MOSFET), with an efficiency close to 100% and an input of a PWM signal; the power amplifier output signal refers to an audio signal output by the class-D power amplifier after power amplification and filtering, which is used to drive a loudspeaker or other load.
[0083] Specifically, the multi-phase pulse width modulation device first inputs the superimposed signal into the power stage of the class-D power amplifier, and the power amplifier amplifies the signal through high-speed switching of power switching tubes to convert the low-power modulation signal into a high-power pulse signal. Subsequently, the high-power signal output by the power amplifier is input into a low-pass filter to filter out the residual high-frequency carrier and harmonic components in the superimposed signal and retain the low-frequency audio signal, and finally an audio output signal with reduced harmonics is obtained, which can directly drive a loudspeaker to restore sound and significantly reduce harmonic distortion.
[0084] Optionally, the superimposed signal is input to a driving circuit of a class-D power amplifier to control the on / off of power switch tubes; the pulse signal output by the power amplifier is filtered by an LC low-pass filter to output a power amplifier output signal with reduced harmonics.
[0085] Optionally, a digital low-pass filtering algorithm is used to pre-process the superimposed signal to remove high-frequency noise; the digital signal is converted into an analog signal by a digital-to-analog converter (DAC) and input to the class-D power amplifier; the power output of the power amplifier is filtered by an active low-pass filter to finally output an audio signal with reduced harmonics.
[0086] It can be understood that other ways can also be used for implementation, for example, a class-D power amplifier chip with integrated filtering function is directly used for processing, which is not limited herein.
[0087] In the above embodiment, the multi-phase pulse width modulation device uses multiple triangular waves with the same phase difference and uniformly distributed as carriers, and when the same sinusoidal audio signal is compared with these triangular waves with phase gradient in amplitude, multiple pulse width modulation (PWM) signals are generated. Although each independent PWM signal still contains the carrier frequency and its harmonics, these harmonic components also inherit the phase difference of the carrier. In the final superposition step, since the useful audio components in all PWM signals are in phase, they are superimposed in phase to be enhanced; and the high-frequency carrier harmonic components interfere and cancel each other due to their uniformly distributed phase difference, so that the main harmonic energy in the final superposition signal is pushed to the integer multiple (N times, N is the number of phases) of the original carrier frequency, and the fundamental carrier and harmonics are significantly weakened. This method makes the superposition signal "purify" the frequency spectrum of the modulated signal before entering the class-D power amplifier, reduces the performance requirements of the low-pass filter in the later stage, and thus realizes the suppression of harmonic distortion of the output signal without increasing the cost and complexity of the filter.
[0088] The method provided by the embodiment is described in further detail below. Please refer to Figure 2 , which is another flowchart of a multi-phase pulse width modulation method for reducing harmonics of a class-D power amplifier in the embodiment.
[0089] S201, based on a preset mapping relationship table, matching the initial number of triangular wave signals corresponding to the rated power of the class-D power amplifier.
[0090] The preset mapping relationship table refers to a corresponding relationship table pre-stored in the multi-phase pulse width modulation device, used for associating the rated power of the class-D power amplifier and the initial number of triangular wave signals, and recording the phase number configuration corresponding to different power intervals in the table; the rated power of the class-D power amplifier refers to the maximum power that the class-D power amplifier can continuously output under rated conditions; and the initial number of triangular wave signals refers to the number of triangular wave carriers initially determined for modulation according to the rated power, which is the basic phase number of multi-phase modulation and can be dynamically adjusted according to the harmonic condition subsequently.
[0091] Specifically, the multi-phase pulse width modulation device first acquires the rated power parameter of the class-D power amplifier (such as reading through a hardware interface or preset by a user), and then queries the preset mapping relationship table. In the table, the rated power is positively correlated with the initial number of triangular waves (for example, 3 phases correspond to a 5W power amplifier, and 6 phases correspond to a 10W power amplifier), because the switching of the power switch tube of a high-power power amplifier is more likely to introduce nonlinear distortion, and more phase numbers are needed to reduce harmonics through phase cancellation. The device determines the initial number of triangular waves corresponding to the current power amplifier by matching the power interval in the table, providing a basis for subsequent phase difference calculation and waveform generation.
[0092] S202. Calculate the phase difference between adjacent triangular wave signals according to the initial number.
[0093] Specifically, after the multi-phase pulse width modulation device acquires the initial number of triangular waves (denoted as N), the phase difference between adjacent triangular waves is determined through mathematical calculation. Since all triangular waves need to cover a complete period of 360° and the phases are uniformly staggered, the phase difference calculation formula is "360° / N" (for example, when N=3, the phase difference is 120°; when N=6, the phase difference is 60°). This calculation ensures that the phase of each triangular wave increases by a fixed difference value, providing phase conditions for subsequent harmonic cancellation when superimposed - high-frequency harmonics interfere with each other due to uniform phase difference, and useful signals are superimposed and enhanced due to the same phase.
[0094] S203. Real-time monitoring of the sinusoidal audio signal to obtain an instantaneous amplitude, and mapping the instantaneous amplitude to a shape adjustment coefficient based on a preset nonlinear mapping relationship.
[0095] The instantaneous amplitude of the sinusoidal audio signal refers to the instantaneous voltage or current size of the sinusoidal audio signal at a certain sampling time, reflecting the strength of the signal at that time; the preset nonlinear mapping relationship refers to a nonlinear function or corresponding table pre-set for converting the instantaneous amplitude to a shape adjustment coefficient, and generally the larger the amplitude, the larger the adjustment coefficient (or changes according to a certain rule); the shape adjustment coefficient is a parameter used to adjust the shape of the peak region of the triangular wave, which smoothes the waveform by changing the peak slope to offset the distortion introduced by the power stage dead time.
[0096] Specifically, the multi-phase pulse width modulation device acquires the instantaneous amplitude of the sinusoidal audio signal through a high-speed sampling module every fixed time (e.g., 1 μs). Since the greater the amplitude of the audio signal, the more significant the influence of the dead time of the subsequent power switch tube on the pulse width (e.g., nonlinear distortion is easy to occur), the device needs to generate a shape adjustment coefficient according to the instantaneous amplitude through a preset nonlinear mapping relationship (e.g., the coefficient is 1 when the amplitude is 0, and the coefficient is 0.3 when the amplitude is the peak value). The coefficient is used to reduce the change step of the peak region of the triangular wave, so that the peak changes from "sharp" to "smooth", compensates for the pulse width deviation caused by the dead time in advance, and reduces the harmonic distortion.
[0097] Optionally, the multi-phase pulse width modulation device acquires the instantaneous amplitude of the sinusoidal audio signal in real time through a high-speed ADC (sampling rate 10 MHz), and outputs the instantaneous amplitude digital quantity; reads the preset nonlinear mapping table (the horizontal axis is the amplitude, and the vertical axis is the coefficient) in the memory; and obtains the corresponding shape adjustment coefficient according to the instantaneous amplitude, and outputs the shape adjustment coefficient to the triangular wave generation module.
[0098] Optionally, the software periodically (e.g., every 10 μs) reads the instantaneous amplitude of the sinusoidal signal through an interrupt service program; calls a nonlinear mapping function (e.g., f(x) = 0.5 + 0.5 * e^(-k|x|), k is a constant) to calculate the adjustment coefficient; and limits the adjustment coefficient (e.g., 0.1 ≤ coefficient ≤ 1) to avoid excessive adjustment.
[0099] It can be understood that other ways can also be used to implement, for example, a neural network model is used to predict the adjustment coefficient, which is not limited here.
[0100] S204, configure an independent digital accumulator for each triangular wave signal to be generated, and set a different initial phase value for each digital accumulator according to the phase difference.
[0101] Specifically, the multi-phase pulse width modulation device allocates an independent digital accumulator (N in total) to each triangular wave according to the initial number N of the triangular wave, to avoid phase interference. The counting range of each accumulator corresponds to the amplitude range of the triangular wave (e.g., 0 ~ 1023). Then, the device sets an initial phase value for the accumulator according to the phase difference (denoted as θ) calculated in S202: the initial phase of the first accumulator is 0°, the initial phase of the second accumulator is θ, the initial phase of the third accumulator is 2θ, and so on, and the initial phase of the Nth accumulator is (N-1)θ. For example, when N = 3 and θ = 120°, the initial phase values correspond to the counting states of 0°, 120°, and 240°, respectively. This configuration ensures that the generated triangular waves are uniformly staggered, which lays a foundation for subsequent harmonic cancellation.
[0102] Optionally, the hardware configuration module of the multiphase pulse width modulation device activates N independent digital accumulators (such as counter IP cores in FPGA) according to the initial number N; calculates the initial phase value (0°, θ, 2θ, …) of each accumulator and converts it into the corresponding initial count value (for example, when the full scale is 1023, 120° corresponds to 341); writes the initial value into the count register of each accumulator to complete the phase configuration.
[0103] Optionally, the software creates a virtual accumulator (array simulation) for each triangular wave through dynamic memory allocation; calculates the starting index of each virtual accumulator according to the phase difference (for example, the array length is 1024 and θ = 60° corresponds to index 171); initializes the starting value of the array to the corresponding index to ensure the phase offset of each virtual accumulator.
[0104] It can be understood that other ways can also be used, such as transmitting the initial phase value to the accumulator through DMA, which is not limited here.
[0105] S205, linearly increases or decreases by a preset step size through a digital accumulator to obtain the rising edge and falling edge of the standard triangular wave.
[0106] Wherein, the preset step size refers to the value of the digital accumulator each time it is incremented or decremented, which determines the slope of the rising edge and falling edge of the triangular wave, the larger the step size, the larger the slope (the steeper the waveform); the rising edge of the standard triangular wave refers to the part of the triangular wave that linearly increases from the valley value to the peak value, the standard triangular wave refers to the part that linearly decreases from the peak value to the valley value, and the absolute values of the slopes of the two are equal (because the step size is the same).
[0107] Specifically, the multiphase pulse width modulation device first determines the triangular wave frequency according to the preset frequency multiplier, and then calculates the preset step size according to the frequency and the count range of the accumulator (step size = full scale value × frequency × 2 / sampling rate, to ensure that the rising and falling is completed within one period). Subsequently, the digital accumulator works according to the preset step size: in the rising edge stage, the accumulator linearly increases from the valley value (such as 0) to the peak value (such as 1023) by the step size; in the falling edge stage, it linearly decreases from the peak value to the valley value by the same step size. The rising edge and falling edge generated by this process have equal absolute values of slope, forming the linear part of the standard symmetrical triangular wave, providing a stable carrier for subsequent superposition modulation.
[0108] S206, when the count value of the digital accumulator enters the preset peak threshold range, a shape adjustment coefficient is used to reduce the preset step size to obtain a variable step size.
[0109] Specifically, the multi-phase pulse width modulation device monitors the count value of the digital accumulator in real time during the generation of the triangular wave. When the count value enters the preset peak threshold range (i.e., the triangular wave is about to reach the peak), the device calls the shape adjustment coefficient obtained in S203 to reduce the preset step length determined in S205 (variable step length = preset step length x shape adjustment coefficient). Since the shape adjustment coefficient is less than 1, the variable step length is less than the preset step length, which makes the increment / decrement rate of the accumulator slow down in the peak region, and the triangular wave peak changes from "sharp turn" to "smooth transition", thereby offsetting the pulse width deviation caused by the subsequent power switch tube dead time in advance and reducing the harmonic distortion.
[0110] S207, continue to increment or decrement the digital accumulator using the variable step length to generate the peak region of the triangular wave signal, and further obtain a plurality of triangular wave signals corresponding to the sinusoidal wave audio signal.
[0111] Specifically, after obtaining the variable step length, the multi-phase pulse width modulation device controls the digital accumulator to continue to increment (rising edge phase) or decrement (falling edge phase) at the step length: when the rising edge approaches the peak value, the accumulator is slowly incremented to the peak value at the variable step length; when the falling edge leaves the peak value, it is slowly decremented to the lower limit of the peak threshold range at the variable step length. Through this process, the smooth peak region of the triangular wave signal is generated. Subsequently, the device splices the rising edge (generated by the preset step length), the peak region (generated by the variable step length), and the falling edge (generated by the preset step length) of each triangular wave to form a complete triangular wave signal. Since the initial phases of the triangular waves have been configured through step S204, a plurality of triangular wave signals with uniform phase difference are finally obtained, providing carriers for subsequent modulation.
[0112] S208, the first instantaneous amplitude is greater than the second instantaneous amplitude.
[0113] Wherein, the first instantaneous amplitude refers to the instantaneous amplitude of the sinusoidal wave audio signal at the current sampling time obtained in step S101, reflecting the strength (such as voltage or current size) of the audio signal; the second instantaneous amplitude refers to the instantaneous amplitude of the current triangular wave signal at the same sampling time, which is converted from the count value of the digital accumulator (such as count value 1023 corresponding to the peak amplitude of the triangular wave).
[0114] Specifically, the multi-phase pulse width modulation device synchronously collects two key data at each sampling time (e.g., every 22.6 μs, corresponding to a sampling rate of 44.1 kHz): one is the first instantaneous amplitude of the sinusoidal audio signal (denoted as A, from the sampling module), and the other is the second instantaneous amplitude of the current triangular wave signal (denoted as B, converted from the accumulator count value). Subsequently, the device compares the values of A and B, and if the value of A is greater than the value of B (i.e., A > B), the output logic of subsequent step S209 is triggered to generate a high-level pulse to reflect the state of the audio signal having a higher amplitude at this time. This determination directly determines the pulse width of the pulse width modulation signal and is the key logic for converting audio information into a pulse signal.
[0115] S209, the output of the pulse width modulation signal at the current sampling time is a first preset level representing a first logic state.
[0116] The first logic state refers to a logic state representing "on" or "high-level active", which is usually represented by the number "1"; the first preset level refers to the physical voltage value (e.g., 3.3 V or 5 V) corresponding to the first logic state, which provides an on-driving signal for the power switch tube.
[0117] Specifically, when the multi-phase pulse width modulation device determines through step S208 that the first instantaneous amplitude of the sinusoidal audio signal is greater than the second instantaneous amplitude of the triangular wave (A > B), it immediately controls the pulse width modulation signal to output the first preset level at the current sampling time. The first preset level is a fixed high voltage (e.g., 3.3 V), representing the first logic state ("1"), which will continue until the next sampling time, until the comparison result changes. By continuously outputting the high level for a certain period of time (pulse width), the pulse width modulation signal encodes the amplitude information of the audio signal into a pulse duty cycle (the higher the amplitude, the longer the high-level duration), providing clear switching control instructions for the class-D power amplifier.
[0118] S210, the output of the pulse width modulation signal at the current sampling time is a second preset level representing a second logic state.
[0119] The second logic state refers to a logic state representing "off" or "low-level active", which is usually represented by the number "0"; the second preset level refers to the physical voltage value (e.g., 0 V) corresponding to the second logic state, which provides an off-control signal for the power switch tube.
[0120] Specifically, when the multi-phase pulse width modulation device determines through step S208 that the first instantaneous amplitude of the sine wave audio signal is less than or equal to the second instantaneous amplitude of the triangular wave (A≤B), the pulse width modulation signal is controlled to output a second preset level at the current sampling moment. The second preset level is a fixed low voltage (such as 0V), representing a second logic state (“0”), which will last until the next sampling moment. Through the duration of the low level, the pulse width modulation signal encodes the low amplitude information of the audio signal as a low duty cycle pulse (the lower the amplitude, the longer the low level duration), ensuring that the power switch tube of the class-D power amplifier is turned off during this period.
[0121] S211, divide the plurality of pulse width modulation signals into at least two signal subsets based on a preset interleaving sequence rule.
[0122] Specifically, after obtaining N pulse width modulation signals (N is the initial number), the multi-phase pulse width modulation device groups them according to a preset interleaving sequence rule. For example, if N=6 and the rule is “odd phases belong to subset 1 and even phases belong to subset 2”, then subset 1 contains signals of phases 1, 3, and 5, and subset 2 contains signals of phases 2, 4, and 6, ensuring that each subset has the same number of signals (3 each). This division ensures that the signals in each subset still maintain uniform distribution of phases, laying a foundation for subsequent harmonic cancellation and independent driving of power amplifier modules, while achieving uniform current stress distribution of power switch tubes.
[0123] S212, superimpose the pulse width modulation signals in each signal subset respectively to generate at least two superimposed signals.
[0124] Specifically, the multi-phase pulse width modulation device independently superimposes the pulse width modulation signals in each signal subset. For example, subset 1 contains 3 PWM signals, and at a certain moment, the signal state is “1, 1, 0”, and after superimposition, the output is “2” (representing high voltage level ratio); at the same time, the signal state of subset 2 is “1, 0, 0”, and after superimposition, the output is “1”. During superimposition, the useful audio components in the subset are enhanced due to the same phase, and the high-frequency harmonics are partially cancelled due to the uniform phase difference. Finally, the same number of superimposed signals as the number of subsets (such as 2) are generated, each carrying part of the power information, which can accurately match the multi-module topology of the power amplifier.
[0125] S213, input each superimposed signal into a corresponding power amplifier module group in the class-D power amplifier.
[0126] Among them, the power amplifier module group refers to an independent power amplification unit divided by function in the class-D power amplifier, and each group corresponds to a signal subset, responsible for part of the power output.
[0127] Specifically, the multi-phase pulse width modulation device transmits each superimposed signal to the corresponding module group in the class-D power amplifier through an independent signal channel. For example, the superimposed signal of subset 1 is input into power amplifier module group 1, and the superimposed signal of subset 2 is input into power amplifier module group 2. Each module group contains an independent power switch tube, a driving circuit, and a filter unit, and after receiving the superimposed signal, the low-power modulation signal is converted into a high-power pulse signal through the on / off of the switch tube. Group driving ensures that each module only processes part of the power, reduces the current stress and heat dissipation pressure of a single module, while retaining the harmonic cancellation advantage of multi-phase modulation.
[0128] In S214, the power output signals of the plurality of power amplifier module groups are synthesized, and the synthesized power output signal is low-pass filtered to obtain a power amplifier output signal with reduced harmonics.
[0129] Specifically, the multi-phase pulse width modulation device first superimposes the power output signals of the plurality of power amplifier module groups through a power synthesis network (such as inductive coupling or transformer synthesis) to aggregate the power outputs of the modules. The synthesized signal still contains high-frequency carrier harmonics, which need to be further processed by a low-pass filter: the filter allows useful signals within the audio frequency band to pass through, while attenuating high-frequency harmonics (such as a 400 kHz carrier and its multiples). In the final output signal, the harmonic components are significantly suppressed, the total harmonic distortion (THD) is greatly reduced, and the signal can directly drive a loudspeaker to restore natural sound.
[0130] In S215, a target amplitude of a highest point of a harmonic closest to a frequency corresponding to a sinusoidal audio signal in a multi-phase PWM spectrum diagram constructed from the superimposed signal is obtained.
[0131] Specifically, the multi-phase pulse width modulation device performs real-time spectral analysis on the superimposed signal, and converts the time-domain superimposed signal into a frequency-domain multi-phase PWM spectrum diagram through fast Fourier transform (FFT). In the spectrum diagram, the fundamental frequency (such as f0=1kHz) of the sinusoidal audio signal is identified, then the harmonic frequency (such as 2f0=2kHz) closest to f0 is found, and the maximum amplitude (target amplitude) of the harmonic peak value is recorded. The size of the target amplitude directly reflects the current harmonic suppression effect: the smaller the amplitude, the lower the harmonic distortion; otherwise, further optimization is required.
[0132] Optionally, the multi-phase pulse width modulation device has a built-in spectrum analyzer hardware module, and the superimposed signal is input into the analyzer for real-time spectral analysis; after the analyzer identifies the fundamental frequency position, it automatically searches for the harmonic peak value of the adjacent frequency and records the highest point amplitude; the target amplitude is converted into a digital quantity and stored in a register for subsequent judgment.
[0133] Optionally, the software samples the superimposed signal to obtain a time-domain data sequence; calls the FFT algorithm to perform frequency domain transformation on the time-domain data to generate spectrum data; traverses the spectrum data to locate the fundamental frequency and the nearest harmonic peak, calculates and outputs the target amplitude.
[0134] It is understandable that other methods can also be used, such as analysis via an external spectrum analyzer, which is not limited here.
[0135] S216. If the target amplitude is greater than or equal to the preset ideal amplitude, then increase the initial quantity of the triangular wave signal corresponding to the rated power.
[0136] Specifically, the multiphase pulse width modulation device compares the target amplitude obtained in step S215 with the preset ideal amplitude: if the target amplitude is greater than or equal to the ideal amplitude (i.e., harmonic distortion exceeds the limit), an adjustment mechanism is triggered, which increases the initial number of triangular wave signals by a preset step size (e.g., from 6 phases to 9 phases). Subsequently, the device re-executes steps S202-S212, generating triangular waves, pulse width modulation signals, and superimposed signals with denser phase differences based on the new initial number. The increased number of phases allows for more thorough cancellation of high-frequency harmonics during superposition, thereby reducing the target amplitude to the ideal range and forming a closed-loop optimization.
[0137] like Figure 3 The diagram illustrates an exemplary scenario of single-phase PWM modulation in related technologies, comprising three parts: an input sine wave, a single-phase PWM signal waveform, and a single-phase PWM one-sided spectrum. The input sine wave is a 1kHz audio signal, which, after 2MHz sampling, presents a standard sine wave, representing the original audio information to be amplified. The single-phase PWM signal is generated by comparing this sine wave with a single 10kHz triangular wave carrier: when the amplitude of the sine wave is higher than that of the triangular wave, a high level (amplitude 0.5) is output, and vice versa, a low level (amplitude 0) is output, forming a pulse signal containing only high and low levels. Its one-sided spectrum shows a significant harmonic peak at 10kHz near the 1kHz fundamental frequency, with a relative amplitude as high as 0.99. The harmonic amplitudes near the fundamental frequency (1kHz) in the spectrum are extremely high (0.99). These harmonics are located within the audio frequency band (20Hz-20kHz) and cannot be completely filtered out by the subsequent low-pass filter, resulting in a deterioration of the total harmonic distortion (THD) of the output audio signal, manifesting as a rough sound and reduced resolution. Harmonic energy is concentrated near the carrier frequency (10kHz), which is very close to the fundamental frequency (1kHz). This places extremely high demands on the cutoff frequency accuracy of the low-pass filter, increasing the design difficulty and cost of the filter. Single triangular wave carrier modulation is susceptible to nonlinear factors such as the dead time of the power switch. Pulse width deviation is directly converted into harmonic distortion, and there is no harmonic cancellation mechanism for multiphase superposition, which causes the distortion to worsen as the power amplifier power increases.
[0138] likeFigure 4 Fig. 3 shows a schematic diagram of an exemplary scenario of using three-phase PWM modulation in the multi-phase pulse width modulation device according to the embodiments of the present application, including input sine wave, multi-phase PWM branch signals, multi-phase PWM superimposed signals, and three-phase PWM single sideband spectrum. The multi-phase pulse width modulation device generates three triangular wave signals corresponding to the sine wave audio signal at a preset frequency multiple. The three triangular wave signals have the same phase difference, and the sum of the phase differences of all adjacent triangular wave signals is equal to 360°. The sampled sine wave audio signal is compared in amplitude with the three triangular wave signals to obtain three pulse width modulation signals corresponding to the triangular wave signals, i.e., the multi-phase PWM branch signals in the figure. It can be seen that these branch signals exist in the form of high-low level pulses, and different colors represent different branches, and the pulse width changes with the amplitude of the sine wave audio signal.
[0139] The three pulse width modulation signals obtained above are superimposed to combine them into one signal, i.e., the multi-phase PWM superimposed signals in the figure. Through superimposition, the useful audio components in the signal are enhanced, and the high-frequency harmonics are reduced due to mutual cancellation of the phase difference.
[0140] The superimposed signal is subjected to spectrum analysis to obtain three-phase PWM single sideband spectrum, i.e., the lowest spectrum graph in the figure. The horizontal axis represents the frequency, and the vertical axis represents the amplitude. From the spectrum graph, the amplitude size distribution of different frequency components in the signal can be clearly seen. It can be seen from the three-phase PWM single sideband spectrum that, compared with single-phase PWM modulation, three-phase PWM modulation can push the harmonics to a higher frequency, and the harmonic amplitude is significantly reduced. As shown in the figure, at some frequency points, the harmonic amplitude is low (such as near 20000Hz, the amplitude is only 0.261374), which means that through three-phase superposition, most of the harmonics in the audio frequency band are effectively cancelled, making the output signal purer, the total harmonic distortion (THD) is reduced, and the quality of the audio signal is greatly improved, which is manifested in the hearing as clearer and more delicate sound.
[0141] Further, as shown in Fig. 4, the multi-phase pulse width modulation device according to the embodiments of the present application can also be used in a multi-channel audio system. The multi-channel audio system includes a plurality of multi-phase pulse width modulation devices, each of which is connected to a corresponding channel of the multi-channel audio system. The multi-phase pulse width modulation device generates three triangular wave signals corresponding to the sine wave audio signal at a preset frequency multiple. The three triangular wave signals have the same phase difference, and the sum of the phase differences of all adjacent triangular wave signals is equal to 360°. The sampled sine wave audio signal is compared in amplitude with the three triangular wave signals to obtain three pulse width modulation signals corresponding to the triangular wave signals, i.e., the multi-phase PWM branch signals in the figure. It can be seen that these branch signals exist in the form of high-low level pulses, and different colors represent different branches, and the pulse width changes with the amplitude of the sine wave audio signal. Figure 5As shown, it is an exemplary scenario diagram of using six-phase PWM modulation by the multi-phase pulse width modulation device in the embodiment of the present application, including input sine wave, multi-phase PWM branch signal, multi-phase PWM superposition signal and six-phase PWM single sideband spectrum. The multi-phase pulse width modulation device generates six triangular wave signals according to a preset frequency multiple, the phase difference between the triangular wave signals is uniform, and the sum of the phase difference of all adjacent triangular wave signals is 360°. The sampled sine wave audio signal is compared with the six triangular wave signals in amplitude, thereby obtaining six corresponding pulse width modulation signals, that is, the "multi-phase PWM branch signal" in the figure. As can be seen from the figure, the branch signals exist in the form of high and low level pulses, different colors represent different branches, and the pulse width changes with the change of the amplitude of the sine wave audio signal.
[0142] The six generated pulse width modulation signals are superimposed and combined into one signal, that is, the "multi-phase PWM superposition signal" in the figure. Through the superposition operation, the useful audio components in the signal are enhanced, and at the same time, due to the specific phase relationship between the six signals, the high frequency harmonics are mutually cancelled due to the phase difference in the superposition process, reducing the harmonic components. The superimposed signal is subjected to spectrum analysis to obtain a six-phase PWM single sideband spectrum, that is, the lowermost spectrum diagram in the figure. The horizontal axis of the spectrum diagram represents the frequency, and the vertical axis represents the amplitude, from which the amplitude size distribution of different frequency components in the signal can be clearly observed.
[0143] Compared with three-phase PWM modulation, six-phase PWM modulation can further push the harmonics to a higher frequency, and the harmonic amplitude is significantly reduced. As can be seen from the six-phase PWM single sideband spectrum diagram, at some frequency points, the harmonic amplitude is very low (such as near 53000Hz, the amplitude is only 0.102982). This shows that through six-phase superposition, the harmonics in the audio frequency band can be more effectively cancelled, greatly reducing the total harmonic distortion (THD), so that the output audio signal is more pure, and in terms of sound quality, the sound is clearer, more natural and higher in restoration degree.
[0144] The multi-phase pulse width modulation device of the embodiment of the present application is used for an electronic device, Figure 6 An architecture schematic diagram of an electronic device suitable for implementing the embodiment of the present application is shown.
[0145] It should be noted that, Figure 6 The electronic device shown is only an example, and should not impose any limitation on the function and use range of the embodiment of the present application.
[0146] Those skilled in the art can understand that all or part of the steps of various methods in the above embodiments can be completed by instructions (computer programs) or by controlling relevant hardware by instructions (computer programs), which can be stored in a computer readable storage medium and loaded and executed by a processor. The electronic device of the embodiment includes a storage medium and a processor, wherein the storage medium stores a plurality of instructions which can be loaded by the processor to execute any step of the method provided by the embodiment of the application.
[0147] Specifically, the storage medium and the processor are directly or indirectly electrically connected to realize the transmission or interaction of data. For example, these elements can be electrically connected to each other through one or more signal lines. The storage medium stores computer execution instructions for realizing the data access control method, including at least one software function module stored in the storage medium in the form of software or firmware, and the processor executes various function applications and data processing by running the software program and the module stored in the storage medium. The storage medium can be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. Among them, the storage medium is used to store programs, and the processor executes the programs after receiving execution instructions.
[0148] Further, the software program and the module in the above storage medium can also include an operating system, which can include various software components and / or drivers for managing system tasks (such as memory management, storage device control, power management, etc.), and can communicate with various hardware or software components to provide a running environment for other software components. The processor can be an integrated circuit chip with processing capability. The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc., which can realize or execute the methods, steps and logic flow diagrams disclosed in the embodiment. The general processor can be a microprocessor or the processor can also be any conventional processor.
[0149] Since the instructions stored in the storage medium can execute the steps in any method provided by the embodiments of the present application, the beneficial effects of any method provided by the embodiments of the present application can be achieved. Details are described in the foregoing embodiments, and will not be described here.
[0150] The above description is merely preferred specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A multiphase pulse width modulation method for reducing harmonics in Class D power amplifiers, applied to a multiphase pulse width modulation device, characterized in that... The method includes: The original audio signal is sampled at a preset sampling rate to obtain a sinusoidal audio signal; Obtain the rated power of the Class D amplifier; The initial number of triangular wave signals corresponding to the rated power is matched based on a preset mapping table, and the rated power is positively correlated with the initial number. Calculate the phase difference between adjacent triangular wave signals based on the initial quantity; The instantaneous amplitude is obtained by real-time monitoring of the sinusoidal audio signal; The instantaneous amplitude is mapped to a shape adjustment coefficient based on a preset nonlinear mapping relationship; Each triangular wave signal to be generated is configured with an independent digital accumulator, and a different initial phase value is set for each digital accumulator according to the phase difference; The rising and falling edges of a standard triangular wave are obtained by linearly increasing or decreasing the digital accumulator with a preset step size. The preset step size is determined based on a preset frequency multiple. When the count value of the digital accumulator enters the preset peak threshold range, the preset step size is reduced using the shape adjustment coefficient to obtain a variable step size; The variable step size is used to continue incrementing or decrementing the digital accumulator to generate the peak region of the triangular wave signal. Multiple triangular wave signals are formed by the rising edge, the falling edge, and the peak region. The phase difference between adjacent triangular wave signals is the same, and the sum of the phase differences of all adjacent triangular wave signals is equal to 360°. The absolute values of the rising edge slope and the falling edge slope of the triangular wave signal are equal. The amplitude of the sinusoidal audio signal is compared with that of each triangular wave signal to obtain the pulse width modulation signal corresponding to each triangular wave signal. Arithmetic superposition of multiple pulse width modulation signals yields one or more multi-level superimposed signals; The superimposed signal is input into a Class D power amplifier to obtain a power amplifier output signal with reduced harmonics.
2. The method according to claim 1, characterized in that, After the step of superimposing the multiple pulse width modulation signals to obtain the superimposed signal, the method further includes: A multiphase PWM spectrum diagram is constructed based on the superimposed signal; Obtain the target amplitude of the highest harmonic point closest to the frequency corresponding to the sinusoidal audio signal in the multiphase PWM spectrum diagram; If the target amplitude is greater than or equal to the preset ideal amplitude, then the initial number of triangular wave signals corresponding to the rated power is increased to obtain a new superimposed signal.
3. The method according to claim 1, characterized in that, The step of comparing the amplitude of the sinusoidal audio signal with each of the triangular wave signals to obtain the pulse width modulation signal corresponding to each triangular wave signal specifically includes: At each sampling moment, the first instantaneous amplitude of the sinusoidal audio signal is compared with the second instantaneous amplitude of a corresponding triangular wave signal; If the first instantaneous amplitude of the sinusoidal audio signal is greater than the second instantaneous amplitude of the triangular wave signal, then the output of the pulse width modulation signal at the current sampling time is a first preset level representing the first logic state; If the first instantaneous amplitude of the sinusoidal audio signal is less than or equal to the second instantaneous amplitude of the triangular wave signal, then the output of the pulse width modulation signal at the current sampling time is a second preset level representing the second logic state.
4. The method according to claim 1, characterized in that, The step of superimposing multiple pulse width modulation signals to obtain a superimposed signal specifically includes: The multiple pulse width modulation signals are divided into at least two signal subsets based on a preset interleaving sequence rule, and each signal subset has the same number of pulse width modulation signals; The pulse width modulation signals in each of the signal subsets are superimposed to generate at least two superimposed signals.
5. The method according to claim 4, characterized in that, The step of inputting the superimposed signal into a Class D power amplifier to obtain a harmonic-reduced power amplifier output signal specifically includes: Each of the superimposed signals is input into the corresponding power amplifier module group in the Class D power amplifier; The power output signals of the multiple power amplifier modules are combined and then low-pass filtered to obtain a power amplifier output signal with reduced harmonics.
6. A multiphase pulse width modulation device, characterized in that, The multiphase pulse width modulation device includes: one or more processors and a memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the multiphase pulse width modulation device to perform the method as described in any one of claims 1-5.
7. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is executed on the multiphase pulse width modulation device, the multiphase pulse width modulation device performs the method as described in any one of claims 1-5.
8. A computer program product, characterized in that, When the computer program product is run on the multiphase pulse width modulation device, the multiphase pulse width modulation device performs the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Class D amplifiers
CN103378812A
D-class amplifier drive method, d-class amplifier drive circuit, electrostatic transducer, ultrasonic speaker, display device, and directional acoustic system
JP2008118248A