Guitar amplifier circuit modeling method based on grey box

Through the extended gray box modeling method of the Wiener-Hamerstein model, the problem of large amount of guitar amplifier circuits in real-time systems is solved, and low-cost and efficient modeling effect is achieved, and it is suitable for a variety of guitar amplifier devices.

CN120354801APending Publication Date: 2025-07-22GUANGZHOU RANTION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510378074.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The existing guitar amplifier circuit modeling methods have a large amount of computing in real-time systems, which is difficult to meet the real-time requirements of embedded devices, and it is difficult to obtain the circuit diagram of old devices, resulting in difficulty in modeling.

Method used

The gray box modeling method based on the extended Wiener-Hamerstein model is adopted, and the cascaded models of prefilters, nonlinear modules and postlinear modules are combined with the bypass simulation vacuum tube bias characteristics to optimize parameters to reduce the calculation amount and improve modeling accuracy.

Benefits of technology

It reduces modeling costs, meets the real-time requirements of embedded devices, and is suitable for different guitar amplifier devices, improving the reliability and efficiency of modeling effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120354801A_ABST
    Figure CN120354801A_ABST
Patent Text Reader

Abstract

The invention discloses a guitar amplifier circuit modeling method based on a grey box, and relates to the technical field of guitar amplifier circuit modeling. Comprising the steps that an input signal is firstly filtered by a prefilter module, so that the distortion amount of each frequency band signal is determined; scaling the input signal and the output signal respectively based on the front gain and the rear gain of the nonlinear module; the signal is changed into a distorted signal after passing through the nonlinear module, and the distorted signal is filtered by a rear linear filtering module H2 (z), so that an overtone component and a frequency component in the distorted signal are determined; according to the digital nonlinear modeling method for the guitar amplifier device based on the grey box model, digital nonlinear modeling of the guitar amplifier device is only related to signals of input / output reference equipment, and the modeling cost is greatly reduced; meanwhile, by observing the structure of the digital model, the calculation amount of the method is relatively small, and the requirement of embedded equipment for real-time performance is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of guitar amplifier circuit modeling, and particularly to a method for modeling a guitar amplifier circuit based on a gray box. Background Art

[0002] Guitar amplifier circuits have always been a research hotspot in virtual analog modeling. Currently, there are mainly two modeling methods: white-box modeling and black-or gray-box modeling.

[0003] The white-box modeling method uses all the information of the reference model for modeling, such as circuit diagrams and the attributes of each component in the circuit. The nonlinear characteristics of the system are described by digitalizing the differential equations of the circuit and establishing state-space equations. In order to successfully model, it is necessary to know the circuit schematic diagram of the entire system and the nonlinear attributes of each component. The white-box modeling method generally includes: state-space method, wave digital filter method, and port-Hamiltonian system (a state-space method described by energy exchange). Since the white-box modeling method is based on the attributes of analog circuits for modeling, the modeling effect is usually relatively good. If you hope that the modeling result can accurately reproduce the sound effect of analog devices, then choosing the white-box modeling method is usually more appropriate.

[0004] However, a relatively fatal disadvantage of white-box modeling is that its computational complexity is very high, and it is difficult to run in real time on an embedded system. Moreover, in the modeling of guitar amplifier circuits, the devices to be modeled usually date back a long time, and it is very difficult to find their complete circuit diagrams. Measuring these devices to obtain their circuit attributes becomes quite difficult, especially since these devices usually include vacuum tube circuits.

[0005] For the gray-box modeling method: One method is to construct a multi-path Hammerstein model. Each path branch represents the harmonic oscillation of a fundamental frequency signal of the input signal. After each branch is processed by non-linear Hammerstein processing, it is then processed by a linear module, which is obtained through exponential sine sweep analysis. The results of this method are relatively good. However, each branch of this model corresponds to an input signal with an amplitude value. When the amplitude value of the input signal is different from theirs, the running effect of the model is relatively poor. Moreover, since each branch contains a polynomial non-linear mapping function, as the number of branches increases, the amount of computation will also increase continuously, thus affecting the operation in a real-time system. Another well-known method is the gray-box modeling method based on the block model, which is mainly divided into three types: One is the method based on the Volterra series as the non-linear kernel. The disadvantage of this method is that it is very complex to calculate the Volterra kernel and it is difficult to apply in a real-time system. Another type is the modeling method based on a linear module in series with a Wiener model. The last type is based on a Hammerstein model in series with a linear model.

[0006] Through the above analysis, combined with the modeling characteristics of the gray box, this paper proposes an extended gray-box modeling method, that is, taking the block as the analysis object, combining the characteristics of the Wiener and Hammerstein models, constructing a cascade model method of a pre-linear module, a non-linear module, and a post-linear module. At the same time, in the method of constructing the non-linear module, a bypass method is introduced to simulate the bias characteristics in the guitar amplifier, and relatively good results are obtained in the modeling effect. Summary of the Invention

[0007] The purpose of the present invention is to solve the shortcomings existing in the prior art, and to propose a gray-box-based guitar amplifier circuit modeling method.

[0008] In order to achieve the above purpose, the present invention adopts the following technical solutions:

[0009] A gray-box-based guitar amplifier circuit modeling method includes: modeling based on a digital model of a non-linear system described by an extended Wiener-Hammerstein model; specifically as follows:

[0010] The input signal passes through a pre-filter module and a non-linear module in sequence, and is output by a post-linear module;

[0011] The input signal is first filtered by the pre-filter module to determine the distortion amount of the signal in each frequency band; when the input signal contains multiple tones, the pre-filter module determines the distortion amount of the intermodulation signal;

[0012] The pre - gain and post - gain based on the non - linear module are used to scale the input and output signals respectively; the bypass envelope detection module simulates the change of the signal bias point. Based on the non - linear characteristics of the bypass analog vacuum tube, the intensity of the signal is controlled by the Gbias parameter.

[0013] Preferably: The generation of the distortion signal of the non - linear module is introduced by a mapping function, and the mapping function is based on a piece - wise hyperbolic tangent function; the positive and negative signals are processed separately, and the mapping function equation is as follows:

[0014]

[0015] where, m(x nl ) is the mapping function symbol, x nl is the input signal of the non - linear module, tanh is the hyperbolic tangent function symbol, k p , k n , g p , g n are the parameters that determine the asymmetric shape of the piece - wise hyperbolic tangent function.

[0016] Preferably: In the modeling method, during the push - pull amplification stage of the guitar amplifier based on the vacuum tube, a vacuum tube is used to process the half - wave signal of the input signal respectively; the piece - wise hyperbolic tangent mapping function is used for phenomenon simulation; the shape characteristics of the mapping function are determined by k p , k n , g p , g n four parameters;

[0017] All the parameters to be optimized in the non - linear module are aggregated into a vector, as follows:

[0018] p nl =(G pre G bias k p k n g p g n G post ) T

[0019] where: p nl is the parameter vector of the non - linear module, G pre , G post are the pre - gain and post - gain respectively, k p , k n , g p , g n are the parameters of the piece - wise hyperbolic tangent function, and G bias is the bias value of the bypass of the non - linear module.

[0020] Preferably, in the modeling method, the signal becomes a distorted signal after passing through the nonlinear module and is finally filtered by the subsequent linear filtering module H2(z), so as to determine the harmonic components and frequency components in the distorted signal; the parameter vector table to be adjusted for the entire digital model is as follows:

[0021]

[0022] p is the parameter set of the entire model, p H,1 , p H,2 are the parameter vectors of the pre-filter module and the subsequent linear module respectively, and p nl is the parameter vector of the nonlinear module;

[0023] When the parameters are adjusted, the output signal of the digital model is the same as the output signal y(n) of the digital analog reference device.

[0024] Preferably, in the modeling method, it further includes optimizing the parameters of the Wiener-Hammerstein model;

[0025] Optimizing the parameters of the Wiener-Hammerstein model is divided into two steps: the first step is the adaptation of the linear module, and the second step is to optimize the parameters of the nonlinear module based on the Levenberg-Marquardt algorithm;

[0026] The frequency responses of the linear filter modules H1(z) and H2(z) are measured by means of two exponential sine sweep signals, and the frequency range of the sweep signals is from 10 Hz to 21 kHz.

[0027] Preferably, when measuring the frequency responses of the linear filter modules H1(z) and H2(z), it is specifically as follows:

[0028] First, measure the impulse response of the sweep signal with a low amplitude, and denote the impulse response of the measured low-amplitude signal as h low (n);

[0029] Secondly, use the same measurement method again, select the amplitude of the sweep signal as 1 V, and denote the impulse response signal as h high (n);

[0030] The impulse response signals obtained from the two sine sweep signals are finally transformed into the frequency domain through Fourier transform to obtain the frequency response signals; divide the frequency response of the low-amplitude sine sweep signal by the frequency response of the high-amplitude sine sweep signal, and the calculation formula is as follows:

[0031]

[0032] H1(z) is the frequency response of the pre-filter module, H low(z) is the impulse response h of a low-amplitude signal low (n) is the frequency response after Fourier transform, H high (z) is the impulse response h of a high-amplitude signal high (n) is the frequency response after Fourier transform;

[0033] The calculated frequency response signal is then transformed back to the time domain signal through the inverse Fourier transform and thus directly applied in the digital model; the frequency response calculation formula of the subsequent linear module filter is as follows:

[0034] H2(z) = H high (z)

[0035] H2(z) is the frequency response of the subsequent linear module, H high (z) is the impulse response h of a high-amplitude signal high (n) is the frequency response after Fourier transform.

[0036] Preferably: in the described modeling method, it further includes iteratively optimizing the parameters of the IIR filter:

[0037] The measured frequency response FIR filter is replaced with an IIR filter; 7 second-order IIR filters are used, including one low-shelf filter, one high-shelf filter, and 5 peak filters; the parameters of the filter include: the cut-off frequencies (f c,lfs , f c,hfs ) and gains (G lfs , G hfs ) of the low-shelf and high-shelf filters, and the cut-off frequency (f c,n ), gain (G n ), and quality factor (Q n value) of the peak filters.

[0038] Preferably: in the described modeling method, it further includes optimizing the parameters of the non-linear module:

[0039] After the optimization of the linear module in the digital model is completed, the parameter optimization of the non-linear module is carried out. During this process, the loss function C(p) is minimized, and the linear module filter parameters P H,1 and P H,2 remain unchanged to reduce the complexity of calculating the loss function;

[0040] The specific calculation formula of the loss function is as follows:

[0041] Y(b,k) = STFT(y(n))

[0042]

[0043]

[0044]

[0045]

[0046] Y(b,k) is the short-time Fourier transform result of the reference model, is the short-time Fourier transform result of the digital model, and R(b,k,p) is the result of the short-time Fourier transform of the reference model and the digital model, which is the difference result after post-processing; is the result value obtained by mapping the spectral residual signal R(n,k,p) to a new frequency band through merging processing; C(p) is the sum of the squares of the entire spectral residual values calculated, that is, the loss function value.

[0047] Preferably: in the modeling method, the output signals of the reference device and the digital model are converted into frequency-domain signals through short-time Fourier transform; in the post-processing, the amplitude of the short-time Fourier transform is calculated and converted into a logarithmic scale, according to the calculation method of the following formula:

[0048]

[0049] Where:

[0050] L offset = 100 (dB)

[0051] max is the sign function for taking the larger of two numbers, and 20·log10(|Y(b,k)|) is to convert the amplitude of the short-time Fourier transform Y(b,k) to the decibel scale, L offset is to define a noise threshold value, take this value as 100 dB, and when the signal is less than -100 dB, it is ignored; L(|Y(b,k)|) is the symbolic representation of the result of post-processing;

[0052] Among them, the spectral residual value is calculated through and the frequency bands of the Fourier transform are merged through

[0053] Preferably: the steps of the non-linear parameter optimization are as follows:

[0054] First, use the grid search method to find the pre-gain G pre and post-gain G post values of the non-linear module that minimize the loss function C(p);

[0055] Second, assign initial values to the parameters of the mapping function: k p = k n = 0.3, g p = g n = 6 (dB), G​bias = 0; During the optimization process of the non - linear module parameters, the parameters of the low - shelf and high - shelf filters are added together with the non - linear parameters as an iterative training model. Through the Levenberg - Marquardt algorithm, when the loss function C(p) is iteratively minimized, the optimal values of the parameters of the non - linear module and the low - shelf and high - shelf filters in the linear module are obtained, thus completing the digital modeling.

[0056] The beneficial effects of the present invention are as follows:

[0057] 1. The digital non - linear modeling of the guitar amplifier equipment based on the grey - box model method of the present invention is only related to the signals of the input / output reference equipment, greatly reducing the cost of modeling. At the same time, from the perspective of the structure of the digital model, the amount of computation of this method is relatively small, meeting the real - time requirements of embedded devices.

[0058] 2. For different guitar amplifier equipment, the present invention only needs to change the parameters of the model to obtain a better - effect model.

[0059] 3. Through the digital modeling of the analog guitar amplifier, the present invention can reduce the cost for users to obtain the effects of this analog device.

[0060] 4. The present invention uses a digital model to replace the analog device, which will greatly reduce the user's usage cost and improve the usage efficiency. The digital model can easily run on a personal computer. Users can conveniently combine other effects with the effects of this model, increasing the playability of the effect pedal. At the same time, it also makes the guitar more entertaining and attracts more people to learn and use the guitar, promoting the development of the industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 is a flowchart of a method for modeling a guitar amplifier circuit based on a grey - box of the present invention;

[0062] Figure 2 is a framework diagram of a general digital non - linear system represented by the extended Wiener - Hammerstein model of the present invention;

[0063] Figure 3 is a signal flow diagram of the non - linear module of the present invention;

[0064] Figure 4 is a flowchart of the amplitude - frequency response of the adaptive optimization parameter fitting measurement signal of the second - order IIR filter bank of the present invention;

[0065] Figure 5 is a block diagram for calculating the loss function based on the spectrum of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0066] The technical solution of the present invention will be further described in detail below in conjunction with specific embodiments.

[0067] Embodiment 1:

[0068] A method for modeling a guitar amplifier circuit based on a gray box includes: modeling based on a digital model of a nonlinear system described by an extended Wiener-Hammerstein model, specifically the following steps:

[0069] As Figure 1 shown, the input signal sequentially passes through a pre-filter module, a nonlinear module, and a post-linear module.

[0070] Among them, x(n) is the input signal, H1(z) is the pre-filter module, the middle is the nonlinear module, and H2(z) is the post-linear module, is the output signal.

[0071] The basic composition principle of a guitar amplifier device is to include pre- and post-filters, and a nonlinear unit such as a vacuum tube in the middle. Therefore, the extended Wiener-Hammerstein model can effectively simulate the model of a guitar amplifier. When this technology is used for system identification of an analog guitar amplifier, only the input / output measurement method needs to be relied on, which can greatly reduce the complexity of the digital model and can perfectly model the system.

[0072] S1: The input signal x(n) is first filtered by the pre-filter module H1(z) to determine the distortion amount of the signal in each frequency band.

[0073] If the pre-filter has a large attenuation degree for the signal in a certain frequency band, then when the signal in this frequency band passes through the nonlinear module, not many overtone signals will be generated, that is, the signal in this frequency band will rarely cause the nonlinear module to enter the saturation state. Another function of the pre-filter module is that when the input signal contains multiple tones, it can determine the distortion amount of the intermodulation signal.

[0074] Specifically, step S1 includes:

[0075] S11: Swept-frequency signal generation: Use exponential swept-frequency signals (10 Hz - 21 kHz) with low amplitude (to avoid nonlinearity) and high amplitude (to drive nonlinearity).

[0076] S12: Frequency response calculation: Obtain the impulse response through deconvolution and deduce the input filter

[0077] and the output filter H2(z) = H high .

[0078] S13: IIR approximation: Convert the long impulse response into a cascade of minimum-phase second-order IIR filters.

[0079] S2: Based on the pre-gain and post-gain of the nonlinear module, scale the input and output signals respectively.

[0080] As Figure 2 shown, the structural block diagram of the nonlinear module is illustrated.

[0081] Among them, Gpre and Gpost are the pre-gain and post-gain of the nonlinear module respectively, which are used to scale the input and output signals respectively.

[0082] The bypassed envelope detection module simulates the change of the signal bias point, which in a guitar amplifier circuit is usually due to the change of the cathode voltage, affecting the anode current of the vacuum tube. Adding this bypass can better simulate the nonlinear characteristics of the vacuum tube, and the intensity of this signal is controlled by the Gbias parameter.

[0083] (1) Step S2 specifically includes:

[0084] S21: Mapping function definition: Adopt a piecewise hyperbolic tangent function to separate the asymmetric saturation characteristics of the positive and negative half-waves. The parameters include the pre-gain (or pre-amplification gain) G pre , the post-gain (or post-amplification gain) G post , the bias gain G bias , the positive connection point k p , the negative connection point k n , the gain g p / g n .

[0085] S22: Parameter initialization: The pre / post-gain determines the initial value through grid search, and other parameters are default

[0086] k p = k n = 0.3, g p = g n = 6dB.

[0087] The generation of the distortion signal of the nonlinear module is introduced by the mapping function, and here the mapping function is based on a piecewise hyperbolic tangent function. It processes the positive signal and the negative signal separately. The mapping function equation is as follows:

[0088]

[0089] Among them, m(x nl ) is the mapping function, x nl is the input signal of the nonlinear module, tanh is the hyperbolic tangent function symbol, k p ,kn , g p , g n is a parameter that determines the asymmetric shape of the piecewise hyperbolic tangent function, and it is also a parameter value obtained through training.

[0090] In the push-pull amplification stage of a vacuum tube-based guitar amplifier, a vacuum tube is used to process the half-wave signal of the input signal respectively. Due to the differences in the input signal and the influence of the circuit in each stage, this process is usually asymmetric. To simulate this process, the proposed piecewise hyperbolic tangent mapping function can fully simulate this phenomenon. The shape characteristics of the mapping function are determined by k p , k n , g p , g n four parameters.

[0091] All the parameters to be optimized in the non-linear module are aggregated into a vector as follows:

[0092] p nl = (G pre G bias k p k n g p g n G post ), Equation (2) T , where:

[0093] Among them: p nl is the parameter vector of the non-linear module, G pre is the pre-gain, G post is the post-gain, k p , k n , g p , g n are the parameters of the piecewise hyperbolic tangent function, and G bias is the bias value of the bypass of the non-linear module.

[0094] S3: After the signal passes through the non-linear module, it becomes a distorted signal and is filtered by the subsequent linear filter module H2(z), so as to determine the harmonic components and frequency components in the distorted signal.

[0095] The parameter vector table to be adjusted for the entire digital model is as follows:

[0096]

[0097] p is the parameter set of the entire model, P H,1 is the parameter vector of the pre-filter module, P H,2 is the parameter vector of the post-linear module, p nl is the parameter vector of the non-linear module.

[0098] When the parameters are appropriately adjusted, the output signal of the digital model should be the same as the output signal y(n) of the digital analog reference device (the actual device output signal), which is the goal of learning and optimizing the model parameters.

[0099] Among them, in the said modeling method, it further includes:

[0100] S4: The optimized parameters of the Wiener-Hammerstein model;

[0101] Measure the frequency responses of the linear filter modules H1(z) and H2(z) by means of two exponentially swept sine signals, and the frequency range of the swept sine signals is from 10 Hz to 21 kHz.

[0102] First, measure the impulse response of the swept sine signal with a low amplitude (generally less than 0.01 V). It is important to select the amplitude of the swept sine signal to be small enough so that the signal will not be distorted when passing through the device, ensuring the accuracy of the measurement results. The impulse response of the low-amplitude signal obtained by measurement is denoted as h low (n). Secondly, use the same measurement method again. This time, the amplitude of the swept sine signal is selected as 1 V, and its impulse response signal is denoted as h high (n).

[0103] The low-amplitude sine swept signal will not expose the nonlinear characteristics of the modeling reference system, so its impulse response is only affected by the filter of the reference system. The impulse response output by the high-amplitude sine swept signal is affected by the nonlinearity and is distorted. The oversaturation state of the nonlinear element removes the influence of the pre-filter, but is affected by the filter unit after the nonlinear element.

[0104] The impulse response signals obtained from the two sine swept signals are finally transformed to the frequency domain through Fourier transform to obtain the frequency response signals. To calculate the filter of the pre-filter module, divide the frequency response of the low-amplitude sine swept signal by the frequency response of the high-amplitude sine swept signal. The calculation formula is as follows:

[0105]

[0106] H1(z) is the frequency response of the pre-filter module, and H low (z) is the frequency response of the impulse response h low (n) of the low-amplitude signal after Fourier transform, and H high (z) is the frequency response of the impulse response h high (n) of the high-amplitude signal after Fourier transform.

[0107] The calculated frequency response signal is then transformed into a time-domain signal through the inverse Fourier transform, so that it can be directly applied in the digital model. The frequency response calculation formula of the subsequent linear module filter is as follows:

[0108] H2(z) = H high (z), Equation (5)

[0109] H2(z) is the frequency response of the subsequent linear module, and H high (z) is the frequency response after the impulse response h high (n) of the high-amplitude signal is transformed by the Fourier transform.

[0110] The optimization parameters of the Wiener-Hammerstein model are divided into two steps:

[0111] S41: Linear module adaptive second-order IIR filter;

[0112] S42: Optimize the parameters of the non-linear module based on the Levenberg-Marquardt method.

[0113] Specifically, S41: Linear module adaptive second-order IIR filter.

[0114] To achieve the resolution of the filter frequency response, the length of the measured impulse response signal needs to be relatively long. However, when the length of the response signal is too long, the time delay becomes correspondingly large. Therefore, the measured frequency response FIR (Finite Impulse Response) filter needs to be approximately replaced by an IIR (Infinite Impulse Response) filter. How many second-order IIR filters are used to replace the FIR filter depends on the measured impulse response and the specific application;

[0115] The present invention uses 7 second-order IIR filters, including a low-shelf filter, a high-shelf filter, and 5 peak filters. The parameters of the filters include: the cut-off frequencies (f c,lfs , f c,hfs ) and gains (G lfs , G hfs ) of the low-shelf and high-shelf filters, the cut-off frequencies (f c,n ), gains (G n ), and quality factor (Q n value) of the peak filters. The method for iteratively optimizing the parameters of the IIR filter is as Figure 3 shown.

[0116] S42: Optimize the parameters of the non-linear module based on the Levenberg-Marquardt method.

[0117] After the optimization of the linear module in the digital model is completed, the parameter optimization of the non-linear module begins. Its essence is to minimize the loss function C(p), where P is the filter parameter of the linear module. H,1 and P H,2 remain unchanged during this process to reduce the complexity of calculating the loss function. The calculation method of the loss function is as follows Figure 4 shown.

[0118] The specific calculation formula of the loss function is as follows:

[0119] Y(b,k) = STFT(y(n)), Equation (6)

[0120]

[0121]

[0122]

[0123]

[0124] Y(b,k) is the result of the short-time Fourier transform (STFT) of the reference model, is the result of the short-time Fourier transform of the digital model, and R(b,k,p) is the result of the short-time Fourier transform of the reference model and the digital model, which is the difference result after post-processing. is the result value of the spectral residual signal R(n,k,p) mapped to a new frequency band through merging processing. C(p) is the sum of the squares of the calculated spectral residual values, that is, the loss function value.

[0125] Convert the output signals of the reference device and the digital model to frequency-domain signals through short-time Fourier transform. In post-processing, calculate the amplitude of the short-time Fourier transform and convert it to a logarithmic scale according to the calculation method of the following formula:

[0126]

[0127] where:

[0128] L offset = 100 (dB)

[0129] max is the sign function that takes the larger of two numbers, and 20·log10(|Y(b,k)|) is to convert the amplitude of the short-time Fourier transform Y(b,k) to the scale of decibels (dB) (i.e., logarithmic scale), and Loffset Define a critical value of noise, and take this value as 100 dB. At such a scale, when the signal is less than -100 dB, during the process of optimizing the parameters, this signal can be ignored. L(|Y(b,k)|) is the symbolic representation of the result of post-processing.

[0130] Among them, through calculate the residual value of the spectrum; through merge the frequency bands of the Fourier transform. This calculation method is based on the semi-octave to calculate the average value of the frequency bands within a certain frequency range. The starting frequency of the semi-octave spectrum is f0 = 27.5 Hz to and the maximum frequency is f M = 19912.13 Hz, where M = 114. The amplitude-frequency of the Fourier transform from 0 Hz to f0 and from f M to f s / 2 are respectively averaged and normalized to a value. Finally, the loss function value C(p) is the result of squaring and summing all the spectrum residual values.

[0131] The data used to confirm the parameters of the nonlinear module include guitar and bass recording signals with different styles and amplitudes, and a multi-frequency sine signal with different amplitudes. The equation of this multi-frequency sine signal is shown as follows:

[0132]

[0133] where f l contains L = 18 signals in the frequency range from f1 = 100 Hz to f L = 8000 Hz, and f mod,l contains L = 18 signals with frequencies linearly spaced from f mod,1 = 0.8 Hz to f mod,L = 0.35 Hz. The amplitude sequence decays exponentially, and the amplitude ranges from a(1) = 1.0 to a(N) = 10 -3 . When all the sine signals are added together, finally, the signal is normalized to a maximum amplitude of 1.

[0134] The steps of optimizing the nonlinear parameters in step S42 are as follows:

[0135] S421: Use the grid search method to find the pre-gain G pre and post-gain G post values of the nonlinear module that minimize the loss function C(p);

[0136] S422: Assign initial values to the parameters of the mapping function: k p = k n = 0.3, g p = g n= 6 (dB), G bias = 0.

[0137] In the process of optimizing the parameters of the nonlinear module, practice has shown that allowing the parameters of the low-shelf and high-shelf filters in the linear module to also change is beneficial to the model effect. Therefore, in this step, the parameters of the low-shelf and high-shelf filters are added together with the nonlinear parameters as the iterative training model. Through the Levenberg-Marquardt algorithm, when the loss function C(p) is minimized by iteration, the optimal values of the parameters of the nonlinear module and the low-shelf and high-shelf filters in the linear module are obtained, thus completing the digital modeling.

[0138] Combined with the review and analysis of guitar amplifier modeling, in the embedded system, it is necessary to find a modeling model with relatively less computational complexity and also hope for a better modeling effect. This paper proposes a gray-box modeling method using an iteratively optimized extended Wiener-Hammerstein model. This modeling method only needs to assume the basic structure of the analog reference model to be modeled as a gray box. By recording the input and output data and continuously iteratively optimizing the parameters of the gray-box model, the modeling method of the analog device is obtained. Practice has proved that this model can meet the requirements of modeling effect and real-time performance and can be applied to products.

[0139] As described above, only the preferred specific embodiments of the present invention are given, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, makes equivalent substitutions or changes, and should be covered by the protection scope of the present invention.

Claims

1. A method for modeling a guitar amplifier circuit based on a gray box, characterized in that, Including: Modeling is performed based on a digital model of a nonlinear system described by an extended Wiener-Hammerstein model. The input signal sequentially passes through a pre-filter module, a nonlinear module, and a post-linear module. Specifically, the steps are as follows: S1: The input signal is first filtered by the pre-filter module to determine the distortion amount of the signal in each frequency band. S2: Based on the pre-gain and post-gain of the nonlinear module, the input and output signals are scaled respectively. Among them, the bypass envelope detection module simulates the change of the signal bias point. Based on the nonlinear characteristics of the bypass analog vacuum tube, the intensity of the signal is controlled by the Gbias parameter. S3: After passing through the nonlinear module, the signal becomes a distorted signal, which is filtered by the post-linear filter module H2(z) to determine the harmonic components and frequency components in the distorted signal. S4: Optimize the parameters of the Wiener-Hammerstein model.

2. The method for modeling a guitar amplifier circuit based on a grey box according to claim 1, wherein, In step S3, the generation of the distorted signal of the nonlinear module is introduced by a mapping function, and the mapping function is based on a piecewise hyperbolic tangent function. The positive and negative signals are processed separately, and the mapping function equation is as follows: where, m(x nl ) is the mapping function symbol, x nl is the input signal of the non-linear module, tanh is the hyperbolic tangent function symbol, k p , k n , g p , g n are the parameters that determine the asymmetric shape of the piecewise hyperbolic tangent function.

3. The method for modeling a guitar amplifier circuit based on a gray box according to claim 2, characterized in that, In the described modeling method, during the push-pull amplification stage of a guitar amplifier based on vacuum tubes, a single vacuum tube is used to process the half-wave signals of the input signal respectively; a piecewise hyperbolic tangent mapping function is used for phenomenon simulation; the shape characteristics of the mapping function are determined by k p , k n , g p , g n Four parameters All the parameters to be optimized in the nonlinear module are aggregated into a vector, as follows: p nl = (G pre G bias k p k n g p g n G post ) T where: p nl is the parameter vector of the nonlinear module, G pre , G post are the pre-gain and post-gain respectively, k p , k n , g p , g n are the parameters of the piecewise hyperbolic tangent function, G bias is the bias value of the bypass of the nonlinear module.

4. A method for modeling a guitar amplifier circuit based on a gray box according to claim 3, characterized in that, In step S3, the parameter vector table to be adjusted for the entire digital model is as follows: p is the set of parameters of the entire model, p H,1 , p H,2 are the parameter vectors of the pre-filter module and the post-linear module respectively, p nl is the parameter vector of the non-linear module; When the parameter is adjusted, the output signal of the digital model is the same as the output signal y(n) of the digital-to-analog reference device.

5. A method for modeling a guitar amplifier circuit based on a gray box according to claim 4, characterized in that, In the described modeling method, it further includes: Step S4: Optimize the parameters of the Wiener-Hammerstein model.

6. A method for modeling a guitar amplifier circuit based on a gray box according to claim 5, characterized in that The described step S4 includes: Step S41: The linear module is an adaptive second-order IIR filter. Step S42: Based on the Levenberg-Marquardt algorithm, optimize the parameters of the nonlinear module. The frequency responses of the linear filter modules H1(z) and H2(z) are measured by means of two exponential sine sweep signals, and the frequency range of the sweep signals is from 10 Hz to 21 kHz.

7. A method for modeling a guitar amplifier circuit based on a gray box according to claim 6, characterized in that When measuring the frequency responses of the linear filter modules H1(z) and H2(z), specifically as follows: First, measure the impulse response of a low-amplitude swept signal, and denote the measured impulse response of the low-amplitude signal as h low (n); Secondly, using the same measurement method again, the amplitude of the swept-frequency signal is selected as 1V, and the impulse response signal is denoted as h high (n); The impulse response signals obtained from the two sine sweep signals are finally transformed into the frequency domain through Fourier transform to obtain the frequency response signals; the frequency response of the low-amplitude sine sweep signal is divided by the frequency response of the high-amplitude sine sweep signal, and the calculation formula is as follows: H1(z) is the frequency response of the pre-filter module, and H low (z) is the impulse response h of the low-amplitude signal low (n) after Fourier transform, and H high (z) is the impulse response h of the high-amplitude signal high (n) after Fourier transform; The calculated frequency response signal is then transformed back to the time domain through inverse Fourier transform, so as to be directly applied in the digital model; the frequency response calculation formula of the post-linear module filter is as follows: H2(z) = H high (z) H2(z) is the frequency response of the post-linear module, and H high (z) is the impulse response h of the high-amplitude signal high (n) after Fourier transform.

8. A method for modeling a guitar amplifier circuit based on a gray box according to claim 7, characterized in that, In the described modeling method, it further includes iteratively optimizing the parameters of the IIR filter: The measured frequency response FIR filter is replaced by an IIR filter. Using 7 second-order IIR filters, including one low-shelf filter, one high-shelf filter and 5 peak filters; the parameters of the filters include: the cut-off frequencies (f c,lfs , f c,hfs ) and gains (G lfs , G hfs ) of the low-shelf and high-shelf filters, the cut-off frequency (f c,n ), gain (G n ), and quality factor (Q n value) of the peak filters.

9. A method for modeling a guitar amplifier circuit based on a gray box according to claim 8, characterized in that, In the described modeling method, it further includes optimizing the parameters of the nonlinear module: After the optimization of the linear module in the digital model is completed, the parameter optimization of the non-linear module is carried out. During the process, the loss function C(p) is minimized, and the linear module filter parameters P H,1 and P H,2 remain unchanged to reduce the complexity of calculating the loss function; The specific calculation formula of the loss function is as follows: Y(b,k) = STFT(y(n)) Y(b,k) is the short-time Fourier transform result of the reference model, is the short-time Fourier transform result of the digital model. R(b,k,p) is the result of the short-time Fourier transform of the reference model and the digital model, which is the difference result after post-processing; is the result value obtained by mapping the spectral residual signal R(n,k,p) to a new frequency band through merging processing; C(p) is the sum of squares of the entire spectral residual value, that is, the loss function value.

10. A method for modeling a guitar amplifier circuit based on a gray box according to claim 9, characterized in that, In the described modeling method, the output signals of the reference device and the digital model are transformed into frequency domain signals through short-time Fourier transform; in the post-processing, the amplitude of the short-time Fourier transform is calculated and transformed into a logarithmic scale, according to the calculation method of the following formula: Where: L offset = 100 (dB) max is a symbolic function that determines the larger of two numbers, and 20·log10(Y(b,k)) is to convert the amplitude of the short-time Fourier transform Y(b,k) to the decibel scale. L offset is to define a noise threshold value, which is taken as 100 dB. When the signal is less than -100 dB, it is ignored; L(Y(b,k)) is the symbolic representation of the result of post-processing. Among them, by calculating the residual value of the spectrum; by merging the frequency bands of the Fourier transform.