Multiphase pulse width modulation method for reducing harmonic waves for D-type power amplifier and related equipment
Through the multi-phase pulse width modulation method, the amplitude of the triangle wave signal with uniformly distributed phase difference is compared and superimposed with the sine wave audio signal, which solves the problem of harmonic distortion in the Class D power amplifier and achieves efficient harmonic suppression and audio quality improvement.
Patent Information
- Application Number
- CN202511323837.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-09-17
AI Technical Summary
The pulse width modulation process of traditional Class D amplifiers has high harmonic distortion, which affects the audio quality.
The multi-phase pulse width modulation method is adopted to generate multiple triangular wave signals with the same phase difference and uniform distribution. The amplitude is compared with the sine wave audio signal to generate multiple pulse width modulation signals, which are superimposed to offset the high-frequency carrier harmonics and reduce harmonic distortion.
Without increasing the cost and complexity of the filter, the harmonic distortion of the Class D amplifier is significantly reduced, and the audio fidelity and power conversion efficiency are improved.
Smart Images

Figure CN120825154A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of broadcasting and television, and in particular to a multi-phase pulse width modulation method and related equipment for reducing harmonics in a Class D power amplifier. Background Art
[0002] With the rapid development of digital information technology, the performance requirements for audio power amplifiers are becoming increasingly stringent in consumer electronics, car audio, professional audio, and portable smart devices. Among various amplifier technologies, Class-D amplifiers have become the mainstream choice for modern audio systems due to their exceptional theoretical efficiency (approaching 100%), extremely low power loss and heat generation, and potential for high integration. Their core operating principle is not linear amplification, but rather converting an input analog audio signal or digital audio stream into a high-frequency pulse-width modulation (PWM) signal. This high-frequency pulse signal controls a power switch (such as a MOSFET) between full on and full off states at high speed, thereby driving loads such as speakers. Because the ideal on-resistance of the switch is zero and the off-resistance is infinite, its inherent power consumption is extremely low, which is the fundamental source of the Class-D amplifier's high efficiency. This operating mode makes Class-D amplifiers particularly suitable for applications with strict power consumption and heat dissipation constraints, such as smartphones, wireless speakers, and new energy vehicle audio systems.
[0003] In related technologies, pulse-width modulation devices typically generate a high-frequency carrier signal at a fixed frequency significantly higher than the highest frequency of the audio signal (typically 20kHz). This carrier signal typically has a standard isosceles triangle or sawtooth waveform. Simultaneously, the input raw audio signal is sampled and processed, and at each sampling moment, its instantaneous amplitude is compared with the instantaneous amplitude of the high-frequency triangle carrier wave. When the audio signal amplitude exceeds 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 audio signal amplitude—a standard pulse-width modulation (PWM) signal. This single PWM signal stream is then used directly to drive the output stage power transistors of a Class D amplifier. After power amplification, it passes through a low-pass filter (LPF) to remove the high-frequency carrier component, ultimately restoring the amplified audio signal to the speaker.
[0004] However, the pulse-width modulation process in related technologies inherently exhibits nonlinearities. In particular, when driving actual power switches, a dead-time interval is required to prevent simultaneous conduction of the upper and lower transistors in the bridge arm, resulting in a short circuit. During this dead-time interval, the output is in a high-impedance state, causing the resulting pulse width to deviate from the ideal width theoretically determined by the audio amplitude. The magnitude of this deviation depends on the instantaneous polarity and rate of change of the audio signal, making it a typical source of nonlinear distortion. This nonlinear effect directly impacts the modulated audio signal, generating harmonic components of the original audio signal within the audio frequency band (20Hz-20kHz). Once generated, these harmonic distortions are mixed with the useful audio signal and cannot be removed by the subsequent low-pass filter. Ultimately, they are directly reflected in the output signal of the power amplifier, resulting in a degraded total harmonic distortion (THD) and a perceived roughness and loss of resolution. Summary of the Invention
[0005] The present application provides a multi-phase pulse width modulation method and related equipment for reducing harmonics in a Class D amplifier, which is used to address the problem that traditional pulse width modulation (PWM) signals generally have high harmonic distortion, thereby affecting the audio quality output by the Class D amplifier.
[0006] In a first aspect, the present application provides a multi-phase pulse width modulation method for reducing harmonics in a Class D power amplifier, which is applied to a multi-phase pulse width modulation device. The method includes: Sampling the original audio signal at a preset sampling rate to obtain a sine wave audio signal; Generate multiple triangular wave signals corresponding to the sine wave audio signal at a preset frequency multiple, wherein adjacent triangular wave signals have the same phase difference, the sum of the phase differences of all adjacent triangular wave signals is equal to 360 degrees, and the absolute values of the rising edge slope and the falling edge slope of the triangular wave signal are equal; Comparing the amplitude of the sine wave audio signal with each of the triangular wave signals respectively to obtain a pulse width modulation signal corresponding to each of the triangular wave signals; Superimposing a plurality of the pulse width modulation signals to obtain a superimposed signal; The superimposed signal is input into a class D power amplifier to obtain a power amplifier output signal with reduced harmonics.
[0007] Through the above-described embodiment, a multiphase pulse-width modulation device uses multiple adjacent, evenly distributed triangular waves with the same phase difference as carrier waves. When the amplitude of a single sinusoidal audio signal is compared with these phase-gradient triangular waves, multiple pulse-width modulated (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 and enhanced. However, due to their evenly distributed phase difference, the high-frequency carrier harmonic components interfere and cancel each other, pushing the main harmonic energy in the final superposed signal to integer multiples (N times, where N is the number of phases) of the original carrier frequency, while the fundamental carrier frequency and harmonics are significantly weakened. This method "purifies" the modulated signal spectrum before the superposed signal enters the Class D amplifier, reducing the performance requirements of the subsequent low-pass filter. This achieves the goal of suppressing harmonic distortion in the output signal without increasing the cost and complexity of the filter.
[0008] In some embodiments, the step of generating a plurality of triangular wave signals corresponding to the sine wave audio signal at a preset frequency multiple specifically includes: Get the rated power of the Class D amplifier; Matching the rated power to an initial number of triangular wave signals based on a preset mapping relationship table, wherein the rated power is positively correlated with the initial number; Calculating the phase difference between adjacent triangle wave signals according to the initial number; A plurality of triangle wave signals corresponding to the sine wave audio signal are generated according to a preset frequency multiple and the phase difference.
[0009] The above-described embodiment considers that the rated power of a power amplifier is generally positively correlated with its output capacity and internal topology complexity, and that high-power amplifiers are often more prone to distortion. The multiphase pulse width modulation device uses the rated power of a Class D amplifier as an input parameter and, through a preset mapping table, directly associates the rated power with the initial number of triangular wave signals, automatically configuring a higher number of modulation phases for amplifiers with higher rated power. Once the initial number is determined, the system accurately calculates the phase difference (360° / initial number) required to achieve optimal harmonic cancellation. This method makes the harmonic suppression solution adaptable to different hardware platforms, enabling the configuration of a lower number of phases for low-power, low-cost amplifiers to conserve computing resources, while also configuring a higher number of phases for high-power, high-performance amplifiers to achieve stronger harmonic suppression.
[0010] In some embodiments, the step of generating a plurality of triangular wave signals corresponding to the sine wave audio signal according to the preset frequency multiple and the phase difference specifically includes: monitoring the sinusoidal audio signal in real time to obtain an instantaneous amplitude; Mapping the instantaneous amplitude to a shape adjustment coefficient based on a preset nonlinear mapping relationship; 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; By using a digital accumulator to linearly increase or decrease the value with a preset step size, a rising edge and a falling edge of a standard triangle wave are obtained, wherein the preset step size is determined according to a multiple of the preset frequency; When the count value of the digital accumulator enters a preset peak threshold range, reducing the preset step length using the shape adjustment coefficient to obtain a variable step length; Continue to increment or decrement the digital accumulator using the variable step size to generate a peak region of the triangular wave signal; A plurality of triangular wave signals are formed according to the rising edge, the falling edge and the peak area.
[0011] Through the above-described embodiment, the multiphase pulse width modulation device obtains a shape adjustment coefficient by real-time monitoring of the instantaneous amplitude of a sinusoidal audio signal and querying the nonlinear mapping relationship. When the digital accumulator used to generate the triangular wave approaches its peak value (i.e., the region where the PWM duty cycle approaches 0% or 100%, which is most susceptible to nonlinear effects such as dead time), the shape adjustment coefficient is used to reduce the preset generation step size. This operation eliminates the sharp linear turning point in the peak region of the triangular wave and makes it relatively smooth. By actively changing the carrier shape, pulse width distortion introduced by factors such as dead time in subsequent power stages is preemptively offset, especially during large signal output. This is equivalent to a second, more targeted suppression of harmonic generation at the root cause, complementing the multiphase cancellation technology to further reduce total harmonic distortion and improve the audio fidelity of the Class D amplifier.
[0012] In some embodiments, after the step of superimposing the plurality of pulse width modulation signals to obtain a superimposed signal, the method further includes: constructing a multi-phase PWM spectrum diagram according to the superimposed signal; Obtaining a target amplitude of the highest point of the harmonic closest to the corresponding frequency of the sinusoidal audio signal in the multi-phase PWM spectrum diagram; If the target amplitude is greater than or equal to the preset ideal amplitude, the initial number of triangular wave signals corresponding to the rated power is increased to obtain a new superposition signal.
[0013] Through the above embodiment, the multi-phase pulse width modulation device constructs its multi-phase PWM spectrum diagram after generating the superimposed signal, obtains the target amplitude of the highest point of the harmonic closest to the audio signal frequency in the spectrum diagram, and compares this actually measured amplitude with a preset ideal amplitude. If the actual harmonic amplitude exceeds the standard, that is, is greater than or equal to the ideal amplitude, a feedback operation is triggered - the initial number of triangular wave signals is increased, and a new superimposed signal is generated and evaluated again. This method enables the multi-phase modulation device to no longer rely solely on the static configuration before leaving the factory, but to be able to self-optimize and calibrate according to the actual signal performance during actual operation, and actively compensate for performance degradation that may be introduced by factors such as temperature drift and component aging.
[0014] In some embodiments, the step of comparing the amplitude of the sine wave audio signal with each of the triangular wave signals to obtain a pulse width modulation signal corresponding to each of the triangular wave signals specifically includes: comparing a first instantaneous amplitude of the sine wave audio signal with a second instantaneous amplitude of a corresponding one of the triangular wave signals at each sampling moment; If the first instantaneous amplitude of the sine wave audio signal is greater than the second instantaneous amplitude of the triangle wave signal, the output of the pulse width modulation signal at the current sampling moment is a first preset level representing a first logic state; If the first instantaneous amplitude of the sine wave audio signal is less than or equal to the second instantaneous amplitude of the triangle wave signal, the output of the pulse width modulation signal at the current sampling moment is a second preset level representing a second logic state.
[0015] In the above embodiment, the multi-phase pulse width modulation device compares the first instantaneous amplitude of a sinusoidal audio signal with the second instantaneous amplitude of a corresponding triangular wave signal. When the audio amplitude is greater than the triangular wave amplitude, the device outputs a first predetermined level representing a first logic state (e.g., a digital '1' or a high level). Otherwise, the device outputs a second predetermined level representing a second logic state (e.g., a digital '0' or a low level), thereby converting the sampled signal into a pulse width modulated signal.
[0016] In some embodiments, the step of superimposing the plurality of pulse width modulation signals to obtain a superimposed signal specifically includes: Dividing the plurality of pulse width modulation signals into at least two signal subsets based on a preset staggered sequence rule, wherein each of the signal subsets 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.
[0017] Through the above embodiment, after obtaining multiple pulse width modulation (PWM) signals, the multi-phase pulse width modulation device divides them into at least two signal subsets of equal number according to a preset interleaving sequence rule. For example, the PWM signals of odd phases can be divided into one group, and the PWM signals of even phases can be divided into another group. Subsequently, the PWM signals in each subset are superimposed separately, thereby generating at least two independent superimposed signals. This method enables each generated independent superimposed signal to be used to accurately drive a power unit in a Class D power amplifier, seamlessly extending the advantages of multi-phase harmonic cancellation in the signal domain to the power domain, allowing different power units of the power amplifier to work in an interleaved manner, thereby achieving further cancellation of output current ripple, improving power conversion efficiency and reducing the demand for output filters.
[0018] In some embodiments, the step of inputting the superimposed signal into a Class D power amplifier to obtain a power amplifier output signal with reduced harmonics specifically includes: Inputting each of the superimposed signals into a corresponding power amplifier module group in a Class D power amplifier; 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.
[0019] Through the above-described embodiment, the multiphase pulse width modulation device inputs independent superimposed signals into corresponding power amplifier module groups within a Class D amplifier. After receiving its corresponding superimposed signal, each power amplifier module group independently performs power amplification to generate its own power output signal. Ultimately, these power output signals from different power amplifier module groups are synthesized and uniformly low-pass filtered to produce the final audio output. This method not only achieves multiphase harmonic cancellation but also equalizes current stress on power devices, optimizes heat dissipation, and reduces output current ripple.
[0020] In a second aspect, the present application provides a multi-phase pulse width modulation device, the multi-phase pulse width modulation device comprising: one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program code, wherein the computer program code includes computer instructions. The one or more processors call the computer instructions so that the multi-phase pulse width modulation device can implement a multi-phase pulse width modulation method for reducing harmonics for a Class D power amplifier provided in the above embodiment, which will not be repeated here.
[0021] In a third aspect, the present application provides a computer-readable storage medium comprising instructions. When the instructions are executed on a multi-phase pulse width modulation device, the multi-phase pulse width modulation device can implement a multi-phase pulse width modulation method for reducing harmonics in a Class D power amplifier provided in the above embodiment, which will not be described in detail here.
[0022] In a fourth aspect, the present application provides a computer program product. When the computer program product runs on a multi-phase pulse width modulation device, the multi-phase pulse width modulation device can implement a multi-phase pulse width modulation method for reducing harmonics in a Class D power amplifier provided in the above embodiment, which will not be repeated here.
[0023] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. By generating an array of triangular wave carriers with precisely stepped phases (totaling 360°), the single modulation process is decomposed into parallel, multi-path modulation. When these pulse-width modulated signals, which carry phase information, are ultimately superimposed, the in-phase useful audio signal is linearly amplified, while the out-of-phase high-frequency carrier harmonics are significantly suppressed due to destructive interference. This architecture further extends the harmonic cancellation advantages of the signal domain to the power domain by grouping the superimposed signals to precisely drive the physical topology of a multi-module amplifier. This fundamentally reduces the harmonic distortion of Class D amplifiers without relying on complex high-order filters.
[0024] 2. A mapping relationship is established between the rated power of the power amplifier, a hardware characteristic, and the initial number of triangular waves to achieve intelligent resource allocation based on hardware capabilities. A closed-loop feedback system is introduced during the dynamic operation phase. By analyzing the spectrum of the superimposed signal in real time, the measured harmonic amplitude is compared with the ideal target, and the number of phases is automatically adjusted accordingly. This makes the multi-phase pulse width modulation device both adaptable to different hardware platforms and self-healing to changes during operation, ensuring the robustness and optimality of the harmonic suppression effect.
[0025] 3. By monitoring the instantaneous amplitude of the audio signal in real time, the shape of the triangular wave carrier's peak is dynamically adjusted, changing it from "sharp" to "smooth." This dynamic adjustment of the carrier effectively acts as a pre-compensation, counteracting impending pulse width nonlinear distortion in the power stage. This technology, combined with polyphase harmonic cancellation, provides a dual guarantee, deeply suppressing distortion from two distinct dimensions (frequency domain cancellation and time domain compensation). The synergistic effect achieves exceptional audio fidelity. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a flow chart of a multi-phase pulse width modulation method for reducing harmonics in a Class D power amplifier according to an embodiment of the present application; Figure 2 This is another flow chart of a multi-phase pulse width modulation method for reducing harmonics in a Class D power amplifier according to an embodiment of the present application; Figure 3 This is a schematic diagram of an exemplary scenario using single-phase PWM modulation in related technologies; Figure 4 This is a schematic diagram of an exemplary scenario in which a multi-phase pulse width modulation device according to an embodiment of the present application uses three-phase PWM modulation; Figure 5 This is a schematic diagram of an exemplary scenario in which a multi-phase pulse width modulation device according to an embodiment of the present application uses six-phase PWM modulation; Figure 6 This is a schematic diagram of the physical device structure of the multi-phase pulse width modulation device in the embodiment of the present application. DETAILED DESCRIPTION
[0027] The terms used in the following examples of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and appended claims of this application, the singular expressions "a," "an," "said," "above," "the," and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in this application refers to any or all possible combinations comprising one or more of the listed items.
[0028] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
[0029] For ease of understanding, the following describes the process of the method provided by this implementation. Figure 1 , which is a flow chart of a multi-phase pulse width modulation method for reducing harmonics in a Class D power amplifier according to an embodiment of the present application.
[0030] S101 : Sampling an original audio signal at a preset sampling rate to obtain a sine wave audio signal.
[0031] Among them, the preset sampling rate refers to the pre-set frequency for discrete sampling of the original audio signal, which usually needs to satisfy the Nyquist sampling theorem (not less than twice the highest frequency of the audio signal, such as 44.1kHz, 48kHz, etc.). In the embodiment of the present application, the preset sampling rate is 2MHz; the original audio signal refers to the unprocessed input audio signal, which can come from a microphone, music file, etc., and is usually a continuous analog signal; the sine wave audio signal refers to a digital audio signal that exhibits sinusoidal wave characteristics after sampling processing, which can approximate the waveform characteristics of the original audio signal.
[0032] Specifically, the multiphase pulse width modulation device receives an external analog audio signal and periodically samples it at a preset sampling rate. Through sampling, the continuous original audio signal is converted into a discrete sequence of digital samples, with each sample corresponding to the signal amplitude at a specific moment. Since the original audio signal can typically be decomposed into a superposition of multiple sine waves, after sampling and basic filtering, the resulting digital signal is presented as a sinusoidal audio signal.
[0033] 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 according to a preset sampling rate and outputs discrete digital samples; the digital samples are passed through a low-pass filter to remove high-frequency noise and ultimately generate a sine wave audio signal.
[0034] Optionally, an external audio source transmits an original digital audio signal to the device via a digital interface (such as I2S); the device resamples the digital signal and adjusts it to a preset sampling rate; decomposes the digital signal into sinusoidal components through Fourier transform, and extracts the main sinusoidal component as a sinusoidal audio signal.
[0035] It is understandable that other methods may be used to implement sampling and conversion, such as performing waveform fitting on the sampled data through a software algorithm to generate a sine wave, which is not limited here.
[0036] S102: Generate a plurality of triangle wave signals corresponding to the sine wave audio signal at a preset frequency multiple.
[0037] Among them, the preset frequency multiple refers to the ratio of the triangular wave signal frequency to the highest frequency of the sine wave audio signal. In the embodiment of the present application, the preset frequency multiple is 10; the triangular wave signal refers to a periodic signal with a triangular waveform, consisting of a rising edge, a falling edge and a peak / peak valley, which serves as a carrier signal for pulse width modulation; the phase difference refers to the phase difference between two adjacent triangular wave signals at the same time. Due to the uniform phase distribution, the single phase difference is 360° divided by the number of triangular waves; the rising edge slope refers to the rate of change of the triangular wave signal in the process of rising from the valley value to the peak value; the falling edge slope refers to the rate of change of the triangular wave signal in the process of falling from the peak value to the valley value. Its absolute value is equal to the rising edge slope to ensure the symmetry of the triangular wave.
[0038] Specifically, the multiphase pulse-width modulation device determines the frequency of the triangular wave based on a preset frequency multiple, and then generates multiple triangular wave signals. These triangular waves have the same frequency but are staggered in phase. The phase differences between adjacent waves are uniform (for example, the phase difference between three triangular waves is 120°), and the sum of all phase differences is 360°, forming a complete phase cycle. Furthermore, the absolute values of the rising and falling slopes of each triangular wave are equal, ensuring waveform symmetry and avoiding additional distortion caused by waveform asymmetry.
[0039] S103 : Compare the amplitude of the sampling signal with each triangular wave signal to obtain a pulse width modulation signal corresponding to each triangular wave signal.
[0040] Among them, the pulse width modulation signal (PWM signal) refers to a digital signal with a fixed amplitude and a pulse width that changes with the amplitude of the audio signal. The duty ratio of the high level and the low level reflects the amplitude information of the audio signal.
[0041] Specifically, at each sampling moment, the multi-phase pulse width modulation device synchronously obtains the instantaneous amplitude of the sinusoidal audio signal (the first instantaneous amplitude) and the instantaneous amplitude of each triangular wave signal (the second instantaneous amplitude). The two are then compared one by one: when the first instantaneous amplitude is greater than the second instantaneous amplitude, a high level (the first preset level) is output; when the first instantaneous amplitude is less than or equal to the second instantaneous amplitude, a low level (the second preset level) is output. Through continuous real-time comparison, each triangular wave generates a pulse width modulation signal whose pulse width varies with the audio signal. The larger the audio signal amplitude, the higher the high-level duty cycle of the PWM signal, thereby encoding the audio information into the pulse width.
[0042] Optionally, the multi-phase pulse width modulation device inputs the sinusoidal audio signal (analog or digital) and the triangular wave signal into the comparator through the comparator hardware circuit; the comparator outputs high and low levels (based on the amplitude) at each moment to form a preliminary PWM signal; the preliminary PWM signal is shaped, and the pulse width modulation signal corresponding to each triangular wave is output after removing the burrs.
[0043] Optionally, at the software level, synchronously read the instantaneous amplitude data of the sine wave and triangle wave at the sampling moment; write comparison logic to determine the amplitude and output the corresponding logic level (1 or 0); convert the logic level sequence into a pulse signal recognizable by the hardware to generate a pulse width modulation signal.
[0044] It is understandable that other methods may also be used to implement the comparison, such as using a dedicated PWM modulation chip to complete the comparison, which is not limited here.
[0045] S104: Superimpose multiple pulse width modulation signals to obtain a superimposed signal.
[0046] Specifically, the multiphase pulse width modulation device superimposes multiple generated PWM signals. Because each PWM signal carries the same audio information (in phase), but the high-frequency carrier harmonics exhibit different phases due to the phase difference of the triangular waves, the in-phase useful audio components are linearly enhanced when superimposed, while the out-of-phase high-frequency harmonics cancel each other out due to destructive interference. In the superimposed signal, the harmonic content within the audio frequency band is significantly reduced, and the high-frequency carrier energy is pushed to a higher frequency, facilitating subsequent filtering and providing a more "pure" modulated signal for the input Class D amplifier.
[0047] Optionally, in three-phase PWM modulation, if the three pulse width modulation signals are all "1" at a certain moment, the moment after superposition is "3"; if the three pulse width modulation signals are "1", "1" and "0" at a certain moment respectively, the moment after superposition is "2".
[0048] S105 , inputting the superimposed signal into a class D power amplifier to obtain a power amplifier output signal with harmonics reduced.
[0049] Among them, low-pass filtering refers to the process of allowing low-frequency signals (audio signals, 20Hz-20kHz) to pass through the filter and suppressing high-frequency signals (carrier and harmonics); Class D power amplifier refers to an amplifier that achieves power amplification through high-speed switching of power switching tubes (such as MOSFET), with an efficiency close to 100%, and the input is a PWM signal; the power amplifier output signal refers to the audio signal output by the Class D power amplifier after power amplification and filtering, which is used to drive loads such as speakers.
[0050] Specifically, the multiphase pulse-width modulation device first inputs the superimposed signal into the power stage of a Class D amplifier. The amplifier then switches and amplifies the signal at high speed through power switches, converting the low-power modulated signal into a high-power pulse signal. The high-power output signal from the amplifier is then fed into a low-pass filter, which removes the remaining high-frequency carrier and harmonic components from the superimposed signal while retaining the low-frequency audio signal. The resulting harmonically reduced audio output signal can directly drive the speakers to reproduce sound with significantly reduced harmonic distortion.
[0051] Optionally, the superimposed signal is input into the driving circuit of the Class D power amplifier to control the on / off of the power switch tube; the pulse signal output by the power amplifier is filtered by an LC low-pass filter to output the power amplifier output signal with reduced harmonics.
[0052] 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 through a digital-to-analog converter (DAC) and input into a Class D amplifier; the power output of the amplifier passes through an active low-pass filter and ultimately outputs an audio signal with reduced harmonics.
[0053] It is understandable that other methods may also be used to implement the above, such as directly processing through a Class D power amplifier chip with integrated filtering function, which is not limited here.
[0054] In the above-described embodiment, the multiphase pulse-width modulation device uses multiple adjacent, evenly distributed triangular waves with the same phase difference as carrier waves. When the amplitude of a single sinusoidal audio signal is compared with these phase-gradient triangular waves, multiple pulse-width modulated (PWM) signals are generated. While 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 and enhanced. However, due to their evenly distributed phase difference, the high-frequency carrier harmonic components interfere and cancel each other, pushing the main harmonic energy in the final superposed signal to integer multiples (N times, where N is the number of phases) of the original carrier frequency, while significantly attenuating the fundamental carrier frequency and harmonics. This method "purifies" the modulated signal spectrum before the superposed signal enters the Class D amplifier, reducing the performance requirements of the subsequent low-pass filter. This achieves the goal of suppressing harmonic distortion in the output signal without increasing the cost and complexity of the filter.
[0055] The following is a more detailed description of the process of the method provided by this implementation. Figure 2 , is another flow chart of a multi-phase pulse width modulation method for reducing harmonics in a class D power amplifier according to an embodiment of the present application.
[0056] S201 : Matching the initial number of triangle wave signals corresponding to the rated power of the class D power amplifier based on a preset mapping relationship table.
[0057] Among them, the preset mapping relationship table refers to a correspondence table pre-stored in the multi-phase pulse width modulation device, which is used to associate the rated power of the Class D power amplifier with the initial number of triangular wave signals. The table records the phase number configuration corresponding to different power intervals; 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; the initial number of triangular wave signals refers to the number of triangular wave carriers used for modulation preliminarily determined based on the rated power, which is the basic phase number of multi-phase modulation, and can be dynamically adjusted subsequently according to the harmonic situation.
[0058] Specifically, the multiphase pulse-width modulation device first obtains the rated power parameters of the Class D amplifier (e.g., read through a hardware interface or preset by the user), then queries a preset mapping table. This table shows a positive correlation between the rated power and the initial number of triangle waves (e.g., a 5W amplifier corresponds to 3 phases, and a 10W amplifier corresponds to 6 phases). Because high-power amplifiers are more susceptible to nonlinear distortion due to power switching, more phases are required to reduce harmonics through phase cancellation. The device matches the power ranges in the table to determine the initial number of triangle waves corresponding to the current amplifier, providing a basis for subsequent phase difference calculation and waveform generation.
[0059] S202: Calculate the phase difference between adjacent triangle wave signals according to the initial number.
[0060] Specifically, after obtaining the initial number of triangular waves (denoted as N), the multiphase pulse width modulation device determines the phase difference between adjacent triangular waves through mathematical calculation. Since all triangular waves must cover a full 360-degree cycle and have evenly staggered phases, 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, providing the phase conditions for harmonic cancellation during subsequent superposition. High-frequency harmonics cancel each other out due to the even phase difference, while the useful signal is amplified due to the same phase.
[0061] S203: monitor the sinusoidal audio signal in real time to obtain an instantaneous amplitude, and map the instantaneous amplitude to a shape adjustment coefficient based on a preset nonlinear mapping relationship.
[0062] Among them, the instantaneous amplitude of the sinusoidal audio signal refers to the instantaneous voltage or current of the sinusoidal audio signal at a certain sampling moment, reflecting the strength of the signal at that moment; the preset nonlinear mapping relationship refers to a pre-set nonlinear function or correspondence table that converts the instantaneous amplitude into a shape adjustment coefficient. Generally, the larger the amplitude, the larger the adjustment coefficient (or changes according to a specific rule); the shape adjustment coefficient is a parameter used to adjust the shape of the peak area of the triangular wave. By changing the peak slope, the waveform is smoothed to offset the distortion introduced by the power stage dead time.
[0063] Specifically, the multiphase pulse width modulation device uses a high-speed sampling module to collect sinusoidal audio signals in real time, obtaining the instantaneous amplitude at fixed intervals (e.g., 1μs). Because the larger the audio signal amplitude, the more significant the impact of the subsequent power switch dead time on the pulse width (prone to nonlinear distortion), the device generates a shape adjustment coefficient based on the instantaneous amplitude using a preset nonlinear mapping relationship (e.g., a coefficient of 1 when the amplitude is 0, and a coefficient of 0.3 when the amplitude is at peak value). This coefficient is subsequently used to reduce the step size of the triangular wave's peak region, changing the peak from "sharp" to "smooth," preemptively compensating for pulse width deviations caused by dead time and reducing harmonic distortion.
[0064] Optionally, the multi-phase pulse width modulation device collects the sinusoidal audio signal in real time through a high-speed ADC (sampling rate 10MHz) and outputs the instantaneous amplitude digital quantity; reads the nonlinear mapping table preset in the memory (the horizontal axis is the amplitude, the vertical axis is the coefficient); obtains the corresponding shape adjustment coefficient according to the instantaneous amplitude lookup table, and outputs it to the triangle wave generation module.
[0065] Optionally, the software periodically (e.g., every 10 μs) reads the instantaneous amplitude of the sine wave signal through an interrupt service routine; calls a nonlinear mapping function (e.g., f(x)=0.5+0.5*e^(-k|x|), where k is a constant) to calculate the adjustment coefficient; and limits the coefficient (e.g., 0.1≤coefficient≤1) to avoid over-adjustment.
[0066] It is understandable that other methods may also be used to achieve this, such as predicting the adjustment coefficient through a neural network model, which is not limited here.
[0067] S204 , configuring an independent digital accumulator for each triangle wave signal to be generated, and setting a different initial phase value for each digital accumulator according to the phase difference.
[0068] Specifically, the multiphase pulse width modulation device assigns an independent digital accumulator (N in total) to each triangular wave based on the initial number N of triangular waves to avoid phase interference. The counting range of each accumulator corresponds to the amplitude range of the triangular wave (e.g., 0 to 1023). Subsequently, the device sets the initial phase value for the accumulator based on the phase difference (denoted as θ) calculated in S202: the first accumulator has an initial phase of 0°, the second θ, the third 2θ, and so on, and the Nth accumulator has an initial phase of (N-1)θ. For example, when N = 3 and θ = 120°, the initial phase values correspond to counting states of 0°, 120°, and 240°, respectively. This configuration ensures that the generated triangular waves are evenly phased, laying the foundation for subsequent harmonic cancellation.
[0069] Optionally, the hardware configuration module of the multi-phase pulse width modulation device activates N independent digital accumulators (such as a counter IP core in an FPGA) according to an initial number N; calculates an initial phase value (0°, θ, 2θ, etc.) of each accumulator and converts it into a corresponding initial counting value (such as 120° corresponds to 341 when the full scale is 1023); and writes the initial value into the counting register of each accumulator to complete the phase configuration.
[0070] Optionally, the software creates a virtual accumulator for each triangle wave through dynamic memory allocation (array simulation); calculates the starting index of each virtual accumulator based on the phase difference (for example, if the array length is 1024 and θ = 60° corresponds to index 171); and initializes the array starting value to the corresponding index to ensure that each virtual accumulator is phase offset.
[0071] It is understandable that other methods may be used for implementation, such as transmitting the initial phase value to the accumulator via DMA, which is not limited here.
[0072] S205 , linearly increasing or decreasing the value with a preset step size by using a digital accumulator to obtain the rising edge and the falling edge of the standard triangle wave.
[0073] The preset step size refers to the value that the digital accumulator increases or decreases each time, which determines the slope of the rising and falling edges of the triangular wave. The larger the step size, the greater the slope (the steeper the waveform). The rising edge of the standard triangular wave refers to the part where the triangular wave linearly increases from the valley value to the peak value, and the standard triangular wave refers to the part where the triangular wave linearly decreases from the peak value to the valley value. The absolute values of the slopes of the two are equal (because the step size is the same).
[0074] Specifically, the multiphase pulse-width modulation device first determines the triangular wave frequency based on a preset frequency multiple. It then calculates a preset step size based on the frequency and the accumulator's counting range (step size = full-scale value × frequency × 2 / sampling rate, ensuring both rising and falling steps occur within a single cycle). The digital accumulator then operates at the preset step size: during the rising phase, the accumulator linearly increments from the valley value (e.g., 0) to the peak value (e.g., 1023) at a given step size; during the falling phase, it linearly decrements from the peak value to the valley value at the same step size. This process generates rising and falling edge slopes with equal absolute values, forming the linear portion of a standard symmetrical triangular wave, providing a stable carrier for subsequent overlay modulation.
[0075] S206 : When the count value of the digital accumulator enters a preset peak threshold range, the shape adjustment coefficient is used to reduce the preset step length to obtain a variable step length.
[0076] Specifically, the multiphase pulse width modulation device monitors the count value of the digital accumulator in real time while it generates the triangular wave. When the count value enters the preset peak threshold range (i.e., the triangular wave is about to reach its peak), the device uses the shape adjustment coefficient obtained in S203 to reduce the preset step size determined in S205 (variable step size = preset step size × shape adjustment coefficient). Because the shape adjustment coefficient is less than 1, the variable step size is smaller than the preset step size. This slows the accumulator's increment / decrement rate in the peak region, transforming the triangular wave's peak from a "sharp transition" to a "smooth transition." This preemptively offsets the pulse width deviation caused by the subsequent power switch dead time, reducing harmonic distortion.
[0077] S207 : Continue to increment or decrement the digital accumulator using a variable step size to generate a peak region of the triangular wave signal, thereby obtaining a plurality of triangular wave signals corresponding to the sine wave audio signal.
[0078] Specifically, after obtaining a variable step size, the multiphase pulse width modulation device controls the digital accumulator to continue incrementing (in the rising edge phase) or decrementing (in the falling edge phase) at that step size: when the rising edge approaches the peak, the accumulator slowly increments to the peak value at a variable step size; when the falling edge leaves the peak value, the accumulator slowly decrements to the lower limit of the peak threshold range at a variable step size. This process generates a flat peak region of the triangular wave signal. The device then concatenates the rising edge (generated by a preset step size), peak region (generated by a variable step size), and falling edge (generated by a preset step size) of each triangular wave to form a complete triangular wave signal. Because the initial phase of each triangular wave has been configured in step S204, multiple triangular wave signals with uniform phase differences are ultimately obtained, providing a carrier for subsequent modulation.
[0079] S208. The first instantaneous amplitude is greater than the second instantaneous amplitude.
[0080] The first instantaneous amplitude refers to the instantaneous amplitude of the sine wave audio signal obtained in step S101 at the current sampling moment, reflecting the strength of the audio signal (such as the voltage or current); the second instantaneous amplitude refers to the instantaneous amplitude of the current triangle wave signal at the same sampling moment, which is converted from the count value of the digital accumulator (for example, a count value of 1023 corresponds to the peak amplitude of the triangle wave).
[0081] Specifically, the multi-phase pulse-width modulation device synchronously collects two key data points at each sampling moment (e.g., every 22.6 μs, corresponding to a 44.1 kHz sampling rate): the first instantaneous amplitude of the sinusoidal audio signal (denoted as A, from the sampling module), and the second instantaneous amplitude of the current triangle wave signal (denoted as B, converted from the accumulator count value). The device then compares the values of A and B. If the value of A is greater than the value of B (i.e., A>B), the output logic of the subsequent step S209 is triggered, generating a high-level pulse to reflect the current state of the higher audio signal amplitude. This judgment directly determines the pulse width of the pulse-width modulated signal and is the key logic for converting audio information into a pulse signal.
[0082] S209 , the output of the pulse width modulation signal at the current sampling moment is a first preset level representing a first logic state.
[0083] Among them, the first logic state refers to the logic state representing "on" or "high level valid", usually represented by the number "1"; the first preset level refers to the physical voltage value corresponding to the first logic state (such as 3.3V or 5V), which provides a conduction drive signal for the power switch tube.
[0084] Specifically, when the multi-phase pulse-width modulation device determines in 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 a first preset level at the current sampling moment. The first preset level is a fixed high voltage (e.g., 3.3V) representing a first logic state ("1"), which persists until the next sampling moment, or until the comparison result changes. By continuously outputting a high level for a certain duration (pulse width), the pulse-width modulation signal encodes the audio signal's amplitude information as a pulse duty cycle (the higher the amplitude, the longer the high level duration), providing clear on / off control instructions for the Class D amplifier.
[0085] S210 , the output of the pulse width modulation signal at the current sampling moment is a second preset level representing a second logic state.
[0086] Among them, the second logic state refers to the logic state representing "cut off" or "low level valid", usually represented by the number "0"; the second preset level refers to the physical voltage value corresponding to the second logic state (such as 0V), which provides a cut-off control signal for the power switch tube.
[0087] Specifically, when the multi-phase pulse width modulation device determines in step S208 that the first instantaneous amplitude of the sinusoidal audio signal is less than or equal to the second instantaneous amplitude of the triangle wave (A ≤ B), it controls the pulse width modulation signal to output a second preset level at the current sampling moment. The second preset level is a fixed low voltage (e.g., 0V), representing a second logic state ("0"), which persists until the next sampling moment. By determining the duration of the low level, the pulse width modulation signal encodes the low amplitude 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 of the Class D amplifier is turned off during this period.
[0088] S211 . Divide a plurality of pulse width modulation signals into at least two signal subsets based on a preset interleaving sequence rule.
[0089] Specifically, after acquiring N pulse-width modulated signals (N is the initial number), the multiphase pulse-width modulation device groups them according to a preset interleaving sequence rule. For example, if N = 6 and the rule is "odd-numbered phases are grouped into subset 1, and even-numbered phases are grouped into subset 2," then subset 1 contains signals from phases 1, 3, and 5, and subset 2 contains signals from phases 2, 4, and 6, ensuring that each subset has the same number of signals (three each). This division ensures that the signals within each subset maintain a uniform phase distribution, laying the foundation for harmonic cancellation and independent driving of power amplifier modules when the subsets are subsequently superimposed, while also achieving equal current stress distribution for the power switches.
[0090] S212: Superimpose the pulse width modulation signals in each signal subset to generate at least two superimposed signals.
[0091] Specifically, the multiphase pulse-width modulation device independently superimposes the pulse-width modulated signals within each signal subset. For example, if subset 1 contains three PWM signals and the signal states are "1, 1, 0" at a certain moment, the superimposed output is "2" (representing the proportion of high-level signals); while the signal states of subset 2 at the same time are "1, 0, 0," the superimposed output is "1." During superposition, the useful audio components within the subsets are enhanced due to their in-phase nature, while the high-frequency harmonics are partially offset due to their uniform phase differences. The resulting superimposed signals are equal in number to the number of subsets (e.g., two), each carrying partial power information, allowing for precise matching with the multi-module topology of the power amplifier.
[0092] S213: Input each superimposed signal into a corresponding power amplifier module group in the Class D power amplifier.
[0093] Among them, the power amplifier module grouping refers to the independent power amplification units in the Class D power amplifier divided by function. Each group corresponds to a signal subset and is responsible for part of the power output.
[0094] 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 to power amplifier module group 1, and the superimposed signal of subset 2 is input to power amplifier module group 2. Each module group contains an independent power switch tube, a drive circuit, and a filter unit. After receiving the superimposed signal, the low-power modulated signal is converted into a high-power pulse signal by turning on / off the switch tube. Group drive ensures that each module only processes part of the power, reducing the current stress and heat dissipation pressure of a single module, while retaining the harmonic cancellation advantage of multi-phase modulation.
[0095] S214 , synthesizing the power output signals of the multiple power amplifier module groups, and performing low-pass filtering on the synthesized power output signal to obtain a power amplifier output signal with reduced harmonics.
[0096] Specifically, the multiphase pulse-width modulation device first combines the power output signals of multiple amplifier modules through a power combining network (such as inductive coupling or transformer combining), summing the power outputs of each module. This combined signal still contains high-frequency carrier harmonics and requires further processing through a low-pass filter. This filter allows the useful signal within the audio band to pass while attenuating high-frequency harmonics (such as the 400kHz carrier and its multiples). The final output signal significantly suppresses harmonics and significantly reduces total harmonic distortion (THD), allowing it to directly drive speakers to reproduce natural sound.
[0097] S215 : Obtain a target amplitude of the highest point of the harmonic closest to the corresponding frequency of the sinusoidal wave audio signal in the multi-phase PWM spectrum diagram constructed from the superimposed signals.
[0098] Specifically, the multiphase pulse width modulation device performs real-time spectrum analysis on the superimposed signal, converting the time-domain superimposed signal into a multiphase PWM spectrum in the frequency domain via a fast Fourier transform (FFT). In this spectrum, the fundamental frequency of the sinusoidal audio signal (e.g., f0 = 1kHz) is identified. The harmonic frequency closest to f0 (e.g., 2f0 = 2kHz) is then searched for, and the maximum amplitude of this harmonic peak (the target amplitude) is recorded. The target amplitude directly reflects the effectiveness of harmonic suppression: smaller amplitudes indicate lower harmonic distortion; smaller amplitudes indicate a need for further optimization.
[0099] Optionally, the multi-phase pulse width modulation device has a built-in spectrum analyzer hardware module, which inputs the superimposed signal into the analyzer for real-time spectrum analysis; after the analyzer identifies the fundamental frequency position, it automatically searches for the harmonic peaks of the adjacent frequencies and records the amplitude of the highest point; the target amplitude is converted into a digital value and stored in a register for subsequent judgment.
[0100] Optionally, the software samples the superimposed signal to obtain a time domain data sequence; calls an FFT algorithm to perform frequency domain conversion on the time domain data to generate spectrum graph data; traverses the spectrum graph data to locate the fundamental frequency and the nearest harmonic peak, and calculates and outputs the target amplitude.
[0101] It is understandable that other methods may also be used to implement the present invention, such as analysis through an external spectrum analyzer, which is not limited here.
[0102] S216: If the target amplitude is greater than or equal to the preset ideal amplitude, increase the initial number of triangular wave signals corresponding to the rated power.
[0103] Specifically, the multiphase PWM device compares the target amplitude obtained in step S215 with a preset ideal amplitude. If the target amplitude is greater than or equal to the ideal amplitude (i.e., harmonic distortion exceeds the specified value), an adjustment mechanism is triggered, increasing the initial number of triangular wave signals (e.g., from 6 to 9 phases) by a preset increment (e.g., by 2 phases at a time). The device then re-executes steps S202-S212, generating a triangular wave, PWM signal, and superimposed signal with a denser phase difference based on the new initial number. A greater number of phases allows for more complete cancellation of high-frequency harmonics during superposition, thereby reducing the target amplitude to within the ideal range, achieving closed-loop optimization.
[0104] like Figure 3The figure below shows an exemplary scenario using single-phase PWM modulation in related art. It includes three parts: an input sine wave, a single-phase PWM signal waveform, and a single-sided spectrum of the single-phase PWM. The input sine wave is a 1kHz audio signal, sampled at 2MHz to produce a standard sine waveform, representing the original audio information to be amplified. The single-phase PWM signal is generated by comparing this sine wave with a single 10kHz triangle wave carrier. When the sine wave amplitude exceeds the triangle wave, a high level (amplitude 0.5) is output; otherwise, a low level (amplitude 0) is output, forming a pulse signal consisting solely of high and low levels. The single-sided spectrum shows a significant harmonic peak at 10kHz, near the 1kHz fundamental frequency, with an amplitude relative to the signal as high as 0.99. The harmonics near the fundamental frequency (1kHz) in the spectrum have extremely high amplitudes (0.99). These harmonics are within the audio band (20Hz-20kHz) and cannot be completely removed by the subsequent low-pass filter. This results in degraded total harmonic distortion (THD) of the output audio signal, resulting in a rough sound and reduced resolution. Harmonic energy is concentrated near the carrier frequency (10kHz), very close to the fundamental frequency (1kHz). This places extremely high demands on the cutoff frequency accuracy of the low-pass filter, increasing the difficulty and cost of filter design. Single triangle-wave carrier modulation is susceptible to nonlinear factors such as the dead time of the power switch tubes. Pulse width deviations directly translate into harmonic distortion, and without a multi-phase superposition harmonic cancellation mechanism, distortion increases with increasing amplifier power.
[0105] like Figure 4 The figure shows an exemplary scenario diagram of a multi-phase pulse width modulation device using three-phase PWM modulation in an embodiment of the present application, including an input sine wave, a multi-phase PWM branch signal, a multi-phase PWM superposition signal, and a three-phase PWM unilateral 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 phase difference between these three triangular wave signals is the same, and the sum of the phase differences of all adjacent triangular wave signals is equal to 360°. The amplitude of the sampled sine wave audio signal is compared with the three triangular wave signals respectively to obtain the pulse width modulation signals corresponding to the three triangular wave signals, namely the "multi-phase PWM branch signal" in the figure. It can be seen that these branch signals exist in the form of high and low level pulses, different colors represent different branches, and their pulse widths change with the amplitude of the sine wave audio signal.
[0106] The three pulse-width modulated signals obtained above are superimposed and combined into a single signal, the "multi-phase PWM superposition signal" in the figure. This superposition enhances the useful audio components in the signal while reducing the high-frequency harmonics due to phase offset.
[0107] Spectral analysis of the superimposed signal yields a single-sided spectrum for the three-phase PWM modulation, shown at the bottom of the figure. The horizontal axis represents frequency, and the vertical axis represents amplitude. The spectrum clearly illustrates the distribution of the amplitudes of the different frequency components in the signal. The single-sided spectrum shows that, compared to single-phase PWM modulation, three-phase PWM modulation pushes harmonics to higher frequencies and significantly reduces their amplitudes. The figure shows that at certain frequencies, the harmonic amplitudes are low (for example, near 20,000 Hz, the amplitude is only 0.261374). This indicates that the three-phase superposition effectively cancels out most of the harmonics within the audio band, resulting in a cleaner output signal and lower total harmonic distortion (THD). This significantly improves audio signal quality, resulting in a clearer and more detailed sound.
[0108] Further, such as Figure 5 The figure shows an exemplary scenario diagram of a multi-phase pulse width modulation device using six-phase PWM modulation in an embodiment of the present application, including an input sine wave, a multi-phase PWM branch signal, a multi-phase PWM superposition signal, and a six-phase PWM unilateral spectrum. The multi-phase pulse width modulation device generates six triangular wave signals based on a preset frequency multiple. The phase difference between these triangular wave signals is uniform, and the sum of the phase differences of all adjacent triangular wave signals is 360°. The sampled sinusoidal audio signal is compared with the amplitude of these six triangular wave signals respectively to obtain six corresponding pulse width modulation signals, namely the "multi-phase PWM branch signals" in the figure. As can be seen from the figure, these branch signals exist in the form of high and low level pulses. Different colors represent different branches, and their pulse widths change with the change of the amplitude of the sinusoidal audio signal.
[0109] The six generated pulse-width modulated signals are superimposed to form a single signal, referred to as the "multi-phase superimposed PWM signal" in the figure. This superposition enhances the useful audio components of the signal. Furthermore, due to the specific phase relationship between the six signals, high-frequency harmonics cancel each other out during the superposition process, reducing the harmonic content. Spectral analysis of the superimposed signal yields a single-sided six-phase PWM spectrum, shown in the spectrum plot at the bottom of the figure. The horizontal axis of the spectrum plot represents frequency, and the vertical axis represents amplitude, clearly demonstrating the amplitude distribution of the different frequency components in the signal.
[0110] Compared to three-phase PWM modulation, six-phase PWM modulation can push harmonics to higher frequencies and significantly reduce their amplitude. As can be seen from the single-sided spectrum of six-phase PWM, at some frequencies, the harmonic amplitudes are very low (for example, near 53000Hz, the amplitude is only 0.102982). This indicates that the six-phase superposition can more effectively cancel harmonics within the audio frequency band, significantly reducing total harmonic distortion (THD), making the output audio signal purer, and the sound quality is more clear, natural, and more accurate.
[0111] The multi-phase pulse width modulation device of the embodiment of the present invention is an electronic device, Figure 6 A schematic diagram of the architecture of an electronic device suitable for implementing an embodiment of the present invention is shown.
[0112] It should be noted that Figure 6 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0113] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be accomplished by instructions (computer programs) or by instructions (computer programs) controlling related hardware. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. The electronic device of this embodiment includes a storage medium and a processor, wherein the storage medium stores multiple instructions that can be loaded by the processor to execute any step of the method provided in the embodiments of the present invention.
[0114] Specifically, the storage medium and the processor are electrically connected, directly or indirectly, to enable data transmission or interaction. For example, these elements may be electrically connected to each other via one or more signal lines. The storage medium stores computer-executable instructions for implementing the data access control method, including at least one software functional module that can be stored in the storage medium in the form of software or firmware. The processor executes various functional applications and data processing by running the software programs and modules stored in the storage medium. The storage medium may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc. The storage medium is used to store programs, and the processor executes the programs after receiving execution instructions.
[0115] Furthermore, the software programs and modules in the above-mentioned storage medium may also include an operating system, which may include various software components and / or drivers for managing system tasks (such as memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components. The processor may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., which may implement or execute the various methods, steps, and logic flow diagrams disclosed in this embodiment. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0116] Since the instructions stored in the storage medium can execute the steps of any method provided in the embodiments of the present invention, the beneficial effects of any method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0117] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A multi-phase pulse width modulation method for reducing harmonics in a Class D power amplifier, applied to a multi-phase pulse width modulation device, characterized in that: The method comprises: Sampling the original audio signal at a preset sampling rate to obtain a sine wave audio signal; Generate multiple triangular wave signals corresponding to the sine wave audio signal at a preset frequency multiple, wherein adjacent triangular wave signals have the same phase difference, the sum of the phase differences of all adjacent triangular wave signals is equal to 360 degrees, and the absolute values of the rising edge slope and the falling edge slope of the triangular wave signal are equal; Comparing the amplitude of the sine wave audio signal with each of the triangular wave signals respectively to obtain a pulse width modulation signal corresponding to each of the triangular wave signals; Superimposing a plurality of the pulse width modulation signals to obtain a superimposed signal; 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 The step of generating a plurality of triangular wave signals corresponding to the sine wave audio signal at a preset frequency multiple specifically includes: Get the rated power of the Class D amplifier; Matching the rated power to an initial number of triangular wave signals based on a preset mapping relationship table, wherein the rated power is positively correlated with the initial number; Calculating the phase difference between adjacent triangle wave signals according to the initial number; A plurality of triangle wave signals corresponding to the sine wave audio signal are generated according to a preset frequency multiple and the phase difference.
3. The method according to claim 2, characterized in that The step of generating a plurality of triangular wave signals corresponding to the sine wave audio signal according to the preset frequency multiple and the phase difference specifically includes: monitoring the sinusoidal audio signal in real time to obtain an instantaneous amplitude; Mapping the instantaneous amplitude to a shape adjustment coefficient based on a preset nonlinear mapping relationship; 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; By using a digital accumulator to linearly increase or decrease the value with a preset step size, a rising edge and a falling edge of a standard triangle wave are obtained, wherein the preset step size is determined according to a multiple of the preset frequency; When the count value of the digital accumulator enters a preset peak threshold range, reducing the preset step length using the shape adjustment coefficient to obtain a variable step length; Continue to increment or decrement the digital accumulator using the variable step size to generate a peak region of the triangular wave signal; A plurality of triangular wave signals are formed according to the rising edge, the falling edge and the peak area.
4. The method according to claim 2, characterized in that After the step of superimposing the plurality of pulse width modulation signals to obtain a superimposed signal, the method further includes: constructing a multi-phase PWM spectrum diagram according to the superimposed signal; Obtaining a target amplitude of the highest point of the harmonic closest to the corresponding frequency of the sinusoidal audio signal in the multi-phase PWM spectrum diagram; If the target amplitude is greater than or equal to the preset ideal amplitude, the initial number of triangular wave signals corresponding to the rated power is increased to obtain a new superposition signal.
5. The method according to claim 1, wherein The step of comparing the amplitude of the sine wave audio signal with each of the triangular wave signals to obtain a pulse width modulation signal corresponding to each of the triangular wave signals specifically includes: comparing a first instantaneous amplitude of the sine wave audio signal with a second instantaneous amplitude of a corresponding one of the triangular wave signals at each sampling moment; If the first instantaneous amplitude of the sine wave audio signal is greater than the second instantaneous amplitude of the triangle wave signal, the output of the pulse width modulation signal at the current sampling moment is a first preset level representing a first logic state; If the first instantaneous amplitude of the sine wave audio signal is less than or equal to the second instantaneous amplitude of the triangle wave signal, the output of the pulse width modulation signal at the current sampling moment is a second preset level representing a second logic state.
6. The method according to claim 1, characterized in that The step of superimposing the plurality of pulse width modulation signals to obtain a superimposed signal specifically includes: Dividing the plurality of pulse width modulation signals into at least two signal subsets based on a preset staggered sequence rule, wherein each of the signal subsets 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.
7. The method according to claim 6, characterized in that The step of inputting the superimposed signal into a Class D power amplifier to obtain a power amplifier output signal with harmonics reduced specifically includes: Inputting each of the superimposed signals into a corresponding power amplifier module group in a Class D power amplifier; 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.
8. A multi-phase pulse width modulation device, characterized in that: The multi-phase pulse width modulation device includes: one or more processors and memory; The memory is coupled to the one or more processors, and is configured to store computer program codes, where the computer program codes include computer instructions. The one or more processors call the computer instructions to enable the multi-phase pulse width modulation device to execute the method according to any one of claims 1 to 7.
9. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on a multi-phase pulse width modulation device, the multi-phase pulse width modulation device is caused to perform the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that When the computer program product is run on a multi-phase pulse width modulation device, the multi-phase pulse width modulation device is caused to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Class D amplifiers
CN103378812A
Sine pulse width modulation PWM (pulse-width modulator) logic competition inhibiting method
CN104124858A
PWM signal implementation method of static reactive power compensation device based on FPGA
CN115411745A
Multi-level D-type power amplifier, PA chip and broadband carrier communication system
CN120512147A
D-class amplifier drive method, d-class amplifier drive circuit, electrostatic transducer, ultrasonic speaker, display device, and directional acoustic system
JP2008118248A
Cited By
Time-span-adjustable pulse generation method and system, converter and medium
CN121841320A
