A web environment-based audio response curve modeling method and system
By combining Gaussian functions and Bézier curves in a web environment, the problem of uneven curve smoothness in audio response curve modeling was solved, achieving high-fidelity and efficient audio response curve processing, thus improving user experience and system performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU BAOLUN ELECTRONICS CO LTD
- Filing Date
- 2025-07-21
- Publication Date
- 2026-05-01
AI Technical Summary
In a web environment, existing audio response curve modeling methods struggle to generate smooth curves, resulting in poor user experience and high computational complexity, which impacts performance.
By combining Gaussian functions and Bézier curves, the Gaussian function is used to accurately simulate the local characteristics of the audio response curve, and the Bézier curve is used to make smooth connections, generating a high-fidelity audio response curve. At the same time, the Gaussian function parameters are directly mapped to the Web Audio API parameters to optimize the processing flow.
It achieves a smooth transition and high fidelity in the audio response curve, improves the user experience, reduces computational complexity and resource consumption, and enhances system performance and real-time performance.
Smart Images

Figure CN120977331B_ABST
Abstract
Description
A Web-based method and system for modeling audio response curves Technical Field
[0001] This invention relates to the field of audio processing, and in particular to a method and system for modeling audio response curves based on a Web environment. Background Technology
[0002] In the field of digital audio processing, the modeling and visualization of audio response curves is a crucial step. An audio response curve describes the ability of an audio device to respond to sound signals of different frequencies. The horizontal axis represents the frequency of the sound, and the vertical axis represents the amplitude of the device's response to that frequency. The audio response curve visually reflects the device's response to or amplification of sounds at different frequencies.
[0003] Existing methods for modeling and drawing audio response curves in a web environment primarily rely on discrete point interpolation. This involves defining a series of control points on the web page and then connecting these points using linear or polynomial interpolation to form a curve. However, when the number of control points is small, this discrete point interpolation method easily produces jagged or unnatural broken lines in the generated audio response curve, failing to smoothly represent complex audio response characteristics. The unevenness and inaccuracy of the audio response curve significantly impacts the user's perception of the adjusted audio effect, making it inconvenient for users to visually adjust the audio response curve.
[0004] Moreover, this interpolation method makes it difficult to flexibly control the local shape of the curve, thus making it difficult to accurately simulate complex audio response curves. Users can only indirectly improve the flexibility of the curve by increasing the number of control points. However, when there are too many control points, complex interpolation calculations may lead to a decrease in the performance of the web page, increase resource consumption, and cause lag.
[0005] On the other hand, when it is necessary to play audio that has been adjusted by the audio response curve, the original audio data must first be received through a filter. Then, the filter adjusts the frequency response and dynamic range of the original audio data according to the parameters corresponding to the shape of the audio response curve to form new audio data to be output to the speaker for playback.
[0006] When processing audio data based on audio response curves in a web environment, existing technologies cannot directly convert the parameter values when drawing the audio response curves into parameters of the Web Audio API or DSP algorithm in the web environment. Therefore, an additional conversion layer or adaptation layer is required to calculate the corresponding Web Audio API or DSP algorithm parameter values based on the shape of the audio response curve, which greatly increases the complexity of the algorithm. Summary of the Invention
[0007] Therefore, the purpose of this invention is to overcome the defects or deficiencies of the prior art and provide a method and system for modeling audio response curves based on a Web environment.
[0008] A method for modeling audio response curves in a web environment includes the following steps:
[0009] S1: Generate frequency and gain based on screen click events, and form control points by having the user input the Q value; or obtain the three parameters of frequency, gain, and Q value input by the user to form control points;
[0010] S2: Convert the frequency, gain, and Q value of the control points into parameters of a Gaussian function and generate connection points using the Gaussian function. After smoothing the connection points using a Bezier curve, draw the audio response curve on the Web.
[0011] By introducing a Gaussian function to accurately simulate the peaks, valleys, and gain or attenuation characteristics of the audio response curve in local regions and specific frequency areas, the natural transition and high fidelity of the audio response curve in local regions are ensured; and a Bezier curve is used to smoothly connect the Gaussian curves in local regions to obtain a highly accurate and sufficiently smooth audio response curve on the web page.
[0012] Further, step S2 includes the following steps:
[0013] S21: Convert the frequency, gain, and Q value of the control point into the parameters μ, A, and σ of a Gaussian function;
[0014] S22: Select characteristic points on the Gaussian function as connection points;
[0015] S23: Generate an audio response curve by smoothly connecting the connection points and the original audio response curve using a Bezier curve.
[0016] Furthermore, in step S21,
[0017] The μ value of the Gaussian function corresponding to the control point is equal to the value of the frequency;
[0018] The value of A of the Gaussian function corresponding to the control point is equal to the value of the gain;
[0019] The σ value of the Gaussian function corresponding to the control point is determined by the Q value and calculated using the following formula:
[0020]
[0021] Where f represents the numerical value of the frequency.
[0022] The Gaussian function naturally possesses the characteristic of a smooth bell curve. By using the Gaussian function, the peaks, valleys, or gain or attenuation characteristics of the audio response curve that the user wants to control can be accurately simulated in a local area. This ensures that the curve forms a natural transition and high fidelity near the control point, avoiding the jagged edges and unnatural over-interpolation phenomena caused by existing traditional interpolation methods.
[0023] Furthermore, the feature points on the Gaussian function are the peak points, half-width at half-maximum (WHM), and inflection points on the Gaussian curve corresponding to the Gaussian function.
[0024] The coordinates of the peak point are (μ, A), corresponding to the center frequency and maximum gain or attenuation of the Gaussian function. The peak point is the target point for the user to adjust the audio response curve; the coordinates of the half-width at half-maximum (WHM) are... It corresponds to two symmetrical points where the Gaussian function drops to half its peak value at maximum gain or attenuation. It directly reflects the influence width of the Gaussian function and is an important transition point connecting the Gaussian function through the Bezier curve. The addition of the half-width point ensures a smooth transition of the audio response curve. The coordinates of the inflection point are (μ±σ,0.606A). The inflection point is the point where the concavity and convexity of the Gaussian function change. It is the critical point where the steepness of the corresponding Gaussian power changes. The inflection point avoids abrupt fluctuations in the curve, which can cause distortion.
[0025] Furthermore, when there are multiple control points, the gains of the overlapping frequency portions of multiple Gaussian functions are superimposed to generate the total gain at the corresponding frequency, forming a new connection point.
[0026] Specifically, for the j-th control point P j Its gain G at frequency f0 j (f) Calculated using the following formula:
[0027]
[0028] in: This represents the octave distance between the current frequency f0 and the center frequency fj of the control point, max(1,f j ) used to avoid f j =0 leads to an error in logarithmic calculation. 1 / max(0.1,Q0) represents the bandwidth determined by the Q value, and max(0.1,Q0) is used to ensure that the Q value is not 0; This indicates the degree of normalization of frequency f0 from the center frequency; S represents the global scaling factor; Gj represents the control point P. j Maximum gain;
[0029] The total gain at frequency f0 is a linear superposition of the gains of all control points at that frequency, i.e.:
[0030]
[0031] When smoothly connecting various connection points and the original audio response curve using Bézier curves, the frequency of the connection point is used as the horizontal axis and the total gain at the frequency is used as the vertical axis to form a new connection point. This new connection point is used as the anchor point for smooth connection of Bézier curves. Each connection point used for Bézier curve connection is affected by all control points, ensuring the accuracy of the audio response curve.
[0032] Furthermore, step S2 also includes:
[0033] S24: Sample the audio response curve at certain frequency intervals to obtain multiple discrete sampling points; use the sampling points as reference points for plotting the audio response curve on the Web;
[0034] S25: Plot a visual audio response curve on the web based on the frequency and gain of each sample point. Connect all sample points through the Canvas API in the web environment to plot a continuous visual audio response curve, providing real-time feedback and visual reference for users to adjust the audio response curve.
[0035] Furthermore, it also includes step S3: mapping the parameters of the Gaussian function to the parameters of the Web Audio API and processing them through a DSP algorithm to obtain a digital audio signal, and converting the digital audio signal into an analog audio signal that can be played by a speaker.
[0036] After adjusting the audio response curve, users can immediately hear the adjusted audio signal. This simulated audio signal forms auditory feedback to achieve real-time audio processing, making it easier for users to adjust the audio response curve more accurately.
[0037] Further, in step S3, the parameters μ, A, and σ of the Gaussian function are directly mapped to the three parameters frequency, gain, and Q of the BiquadFilterNode in the Web Audio API. The frequency of each BiquadFilterNode is the μ of its corresponding Gaussian function, and the gain is the A of its corresponding Gaussian function. Q is calculated using the following formula:
[0038] By establishing a direct mapping between the parameters of the Gaussian function and the parameters of the Web Audio API, intermediate conversion steps are reduced, development efficiency is improved, and system performance is optimized.
[0039] A web-based audio response curve modeling system, comprising:
[0040] The user interaction module is used to generate frequency and gain based on screen click events, and form control points by having the user input the Q value; or to obtain the three parameters of frequency, gain, and Q value input by the user to form control points.
[0041] The curve plotting module is used to convert the frequency, gain, and Q value of control points into parameters of a Gaussian function and generate connection points using the Gaussian function. After smoothing the connection points with a Bézier curve, the audio response curve is plotted on the web interface.
[0042] Furthermore, the curve drawing module includes:
[0043] The Gaussian function calculation unit is used to convert the frequency, gain, and Q value corresponding to the control point into the parameters μ, A, and σ of the Gaussian function; the μ value of the Gaussian function corresponding to the control point is equal to the value of the frequency; the A value of the Gaussian function corresponding to the control point is equal to the value of the gain; the σ value of the Gaussian function corresponding to the control point is determined by the Q value and calculated using the following formula: Where f represents the numerical value of the frequency;
[0044] The connection point generation unit is used to select feature points on the Gaussian function as connection points; the feature points on the Gaussian function are the peak points, full width at half maximum (FWHM) points, and inflection points on the Gaussian curve corresponding to the Gaussian function.
[0045] The curve smoothing unit is used to smoothly connect the connection points and the original audio response curve using Bézier curves to generate an audio response curve.
[0046] To better understand and implement this invention, the following detailed description is provided in conjunction with the accompanying drawings. Attached Figure Description
[0047] Figure 1 is a framework diagram of an audio response curve modeling system based on a Web environment according to the present invention;
[0048] Figure 2 is a flowchart of an audio response curve modeling method based on a Web environment according to the present invention. Detailed Implementation
[0049] To address the issue of jagged or unnatural broken lines appearing in audio response curves when modeling audio response curves in a web environment using existing technologies, this invention designs a web-based audio response curve modeling method and system. By introducing a Gaussian function to accurately simulate the peaks, valleys, and gain or attenuation characteristics of the audio response curve in local regions and specific frequency areas, this ensures a natural transition and high fidelity in local areas. Furthermore, Bézier curves are used to smoothly connect the Gaussian curves in local regions, resulting in a highly accurate and sufficiently smooth audio response curve on the web page. When multiple control points exist, this modeling method does not rely on interpolation to update the audio response curve, improving the smoothness of audio response curve editing. On the other hand, by establishing a direct mapping relationship between the parameters of the Gaussian function and Bézier curve used to generate the audio response curve and the parameters of the Web Audio API or DSP algorithm, this modeling method avoids the complex parameter transformations required when converting audio processed from the audio response curve into playable audio, thus improving system efficiency and performance.
[0050] Please refer to Figures 1 and 2, where Figure 1 is a framework diagram of an audio response curve modeling system based on a web environment according to the present invention, and Figure 2 is a flowchart of an audio response curve modeling method based on a web environment according to the present invention. The audio response curve modeling system based on a web environment includes a user interaction module 10, a curve drawing module 20, and an audio simulation module 30.
[0051] The user interaction module 10 is used to perform step S1: generate frequency and gain based on screen click events, and form a control point by having the user input the Q value; in another embodiment, the user can also directly input the three parameters of frequency, gain and Q value to form a control point.
[0052] Specifically, the web page features a coordinate axis for plotting an audio response curve, with the vertical axis representing gain and the horizontal axis representing frequency. The original state of the audio response curve is a straight line on the coordinate axis where the gain is 0 at any frequency. Users can obtain the frequency and gain by clicking any point on the coordinate axis through screen click events, and input the Q value to form a control point; or they can directly input the three parameters of frequency, gain, and Q value to form a control point to adjust the original audio response curve.
[0053] The user interaction module 10 includes a screen coordinate recognition unit 11 and a coordinate parameter conversion unit 12.
[0054] When a user wants to adjust the original audio response curve via a screen tap event:
[0055] The screen coordinate recognition unit 11 is used to perform step S11: converting the user's screen click event into screen coordinates;
[0056] The coordinate parameter conversion unit 12 is used to perform step S12: obtain the frequency and gain according to the position of the screen coordinates in the coordinate axis of the audio response curve to form control points.
[0057] When the user wants to directly input three parameters—frequency, gain, and Q value—to form control points to adjust the original audio response curve, steps S11 and S12 are not executed.
[0058] The curve drawing module 20 is used to perform step S2: convert the frequency, gain, and Q value of the control points into parameters of a Gaussian function and generate connection points through the Gaussian function, smooth the connection points through a Bezier curve, and then draw the audio response curve on the Web.
[0059] Gaussian functions can accurately simulate the peaks, valleys, and gain or attenuation characteristics of audio response curves in local regions, thereby ensuring a natural transition and high fidelity of the audio response curve in local regions; Bezier curves smoothly connect Gaussian curves in local regions to obtain highly accurate and sufficiently smooth audio response curves on web pages.
[0060] Specifically, the curve drawing module 20 includes a Gaussian function calculation unit 21, a connection point generation unit 22, a curve smoothing unit 23, a discrete sampling unit 24, and a curve drawing unit 25.
[0061] The Gaussian function calculation unit 21 is used to perform step S21: converting the frequency, gain, and Q value corresponding to the control point into the parameters μ, A, and σ of the Gaussian function, where μ represents the axis of symmetry of the Gaussian function, A represents the amplitude of the Gaussian function, and σ represents the standard deviation of the Gaussian function.
[0062] Specifically, the μ value of the Gaussian function corresponding to the control point is equal to the frequency value, where μ represents the center frequency of the Gaussian function and the center position of the Gaussian curve, corresponding to its horizontal axis on the audio response curve. The A value of the Gaussian function corresponding to the control point is equal to the gain value, where A represents the peak height of the Gaussian curve, corresponding to its vertical axis on the audio response curve.
[0063] In this embodiment, the σ value of the Gaussian function corresponding to the control point is determined by the Q value and calculated using the following formula:
[0064]
[0065] Where f represents the frequency value and Q represents the Q value. When the Q value is larger, the value of σ is smaller, the curve corresponding to the Gaussian function is steeper, and its peak is narrower. Therefore, it can only affect the audio response curve in a narrow frequency range near its center frequency. When the Q value is smaller, the value of σ is larger, the curve corresponding to the Gaussian function is flatter, and its peak is wider. Therefore, it can affect the audio response curve in a wider frequency range near its center frequency.
[0066] The Gaussian function naturally possesses the characteristic of a smooth bell curve. By using the Gaussian function, the peaks, valleys, or gain or attenuation characteristics of the audio response curve that the user wants to control can be accurately simulated in a local area. This ensures that the curve forms a natural transition and high fidelity near the control point, avoiding the jagged edges and unnatural over-interpolation phenomena caused by existing traditional interpolation methods.
[0067] The connection point generation unit 22 is used to perform step S22: selecting feature points on the Gaussian function as connection points.
[0068] Specifically, in this embodiment, the feature points are the peak point, half-width at half-maximum (FWHM), and inflection point on the Gaussian curve corresponding to the Gaussian function. The coordinates of the peak point are (μ, A), corresponding to the center frequency and maximum gain or attenuation of the Gaussian function. The peak point is the target point for the user to adjust the audio response curve; the coordinates of the FWHM are... It corresponds to two symmetrical points where the Gaussian function drops to half its peak value at maximum gain or attenuation. It directly reflects the influence width of the Gaussian function and is an important transition point connecting the Gaussian function through the Bezier curve. The addition of the half-width point ensures a smooth transition of the audio response curve. The coordinates of the inflection point are (μ±σ,0.606A). The inflection point is the point where the concavity and convexity of the Gaussian function change. It is the critical point where the steepness of the corresponding Gaussian power changes. The inflection point avoids abrupt fluctuations in the curve, which can cause distortion.
[0069] The curve smoothing unit 23 is used to perform step S23: smoothly connect the connection points and the original audio response curve using a Bezier curve to generate an audio response curve.
[0070] Specifically, at the endpoints of the frequency range affected by the Gaussian function, the connection points on the original audio response curve are selected as anchor points for the Bézier curve. In this embodiment, the abscissa of the anchor point is (μ±σ), while in other embodiments, the anchor point can be (μ±2σ) or (μ±3σ). Then, based on the connection points generated in step S22, these connection points are also used as anchor points for constructing the Bézier curve. These anchor points are connected by a smooth Bézier path through the Bézier curve to form a continuous and smooth audio response curve. In this embodiment, the type of the Bézier curve is a cubic Bézier curve, which has sufficient flexibility and can completely express the characteristics of the bell-shaped Gaussian curve corresponding to the Gaussian function. Furthermore, multiple segments of the cubic Bézier curve can be seamlessly connected, which can adapt to the situation where there are multiple Gaussian functions and multiple connection points in the audio response curve. On the other hand, in the Web environment, cubic Bézier curves are natively supported, without the need to write additional algorithms. In other embodiments, the Bézier curve can be a Bézier curve of any degree or a segmented Bézier curve.
[0071] Preferably, when the user inputs multiple adjustment parameters or executes multiple screen click events to generate multiple control points, forming multiple Gaussian functions and connection points of multiple Gaussian functions, it is necessary to superimpose the gains of the overlapping frequency parts of the multiple Gaussian functions to generate the total gain of the corresponding frequency to form a new connection point.
[0072] Specifically, when there are multiple control points, for the j-th control point P j Its gain G at frequency f0 j (f) Calculated using the following formula:
[0073]
[0074] in: This represents the octave distance between the current frequency f0 and the center frequency fj of the control point, max(1,f j ) used to avoid f j =0 leads to logarithmic calculation errors. 1 / max(0.1,Q0) represents the bandwidth determined by the Q value. max(0.1,Q0) is used to ensure that the Q value is not 0, avoiding the error of dividing by zero. The bandwidth is inversely proportional to the Q value. The larger the Q value, the narrower the bandwidth. The bandwidth determines the size of the frequency range affected by the control point. This indicates the degree of normalization of frequency f0 from the center frequency; S represents the global scaling factor, used to further adjust the sharpness of the curve; the larger the S value, the narrower the curve; Gj represents the control point P. j The maximum gain (when f0 = fj, the exponential part is 0, and Gj(f) contributes Gj).
[0075] The total gain at frequency f0 is a linear superposition of the gains of all control points at that frequency, i.e.:
[0076]
[0077] When smoothly connecting various connection points and the original audio response curve using Bézier curves, the frequency of the connection point is used as the horizontal axis and the total gain at the frequency is used as the vertical axis to form a new connection point. This new connection point is used as the anchor point for smooth connection of Bézier curves. Each connection point used for Bézier curve connection is affected by all control points, ensuring the accuracy of the audio response curve.
[0078] The discrete sampling unit 24 is used to perform step S24: sampling the audio response curve at a certain frequency interval to obtain multiple discrete sampling points.
[0079] Specifically, based on the audio response curve obtained in step S23, multiple sampling points are captured at certain intervals to obtain the frequency and gain of each sampling point. The frequency is used as the horizontal axis and the gain is used as the vertical axis to obtain the coordinates of each sampling point. The sampling points are used as reference points for drawing the audio response curve on the Web.
[0080] The curve plotting unit 25 is used to perform step S25: plotting a visualized audio response curve on the Web based on the frequency and gain of each sampling point. Specifically, all sampling points are connected through the Canvas API in the Web environment to plot a continuous visualized audio response curve, providing real-time feedback and visual reference for users to adjust the audio response curve.
[0081] The audio simulation module 30 is used to perform step S3: mapping the Gaussian function parameters to the parameters of the Web Audio API and processing them with a DSP algorithm to obtain a digital audio signal, and converting the digital audio signal into an analog audio signal that can be played by a speaker.
[0082] Specifically, the audio analog module 30 includes an audio parameter mapping unit 31, an audio signal processing unit 32, and an audio analog-to-electronic conversion unit 33.
[0083] The audio parameter mapping unit 31 is used to perform step S31: directly mapping the parameters μ, A, σ of the Gaussian function to the parameters of the Web Audio API.
[0084] Specifically, in this embodiment, the BiquadFilterNode node in the Web Audio API is used as a filter to directly adjust the audio based on the audio response curve, thereby enabling real-time acquisition of the audio after audio response curve editing. To ensure that the audio signal heard by the end user is consistent with the processed audio signal displayed on the web page, the parameter values on the audio response curve on the web page need to be converted back to the parameter values used by the BiquadFilterNode node for processing the audio signal.
[0085] Each BiquadFilterNode node has three parameters that need to be assigned values (frequency, gain, and Q). During the conversion, since the audio response curve on the web page is smoothly connected by feature points on a Gaussian function, the parameters μ, A, and σ of the Gaussian function can be directly mapped to the three parameters frequency, gain, and Q of the BiquadFilterNode node. This ensures that the audio signal heard by the final user is consistent with the audio signal processed by the audio response curve actually seen by the user on the web page. Each Gaussian function corresponds to one BiquadFilterNode node, and the frequency of each BiquadFilterNode node is the μ of its corresponding Gaussian function, and the gain is the A of its corresponding Gaussian function. In this embodiment, Q is calculated using the σ and μ of the Gaussian function, and its calculation formula is as follows:
[0086] By establishing a direct mapping between the parameters of the Gaussian function and the parameters of the Web Audio API, intermediate conversion steps are reduced, development efficiency is improved, and system performance is optimized.
[0087] The audio signal processing unit 32 is used to execute step S32: processing the parameters of the Web Audio API using a DSP algorithm to obtain a digital audio signal. This digital audio signal is an audio signal adjusted by the audio response curve.
[0088] The audio analog-to-digital conversion unit 33 is used to perform step S33: converting the digital audio signal into an analog audio signal that can be played by the speaker through digital-to-analog conversion. After adjusting the audio response curve, the user can hear the adjusted audio signal immediately. The analog audio signal forms auditory feedback to achieve real-time audio processing, making it more convenient for the user to adjust the audio response curve more accurately.
[0089] Compared to existing methods for modeling audio response curves in a web environment using interpolation, the audio response curve modeling method and system based on a web environment of this invention simulates the local shape near each control point of the audio response curve using a Gaussian function. Multiple connection points are formed on each Gaussian function, and a Bézier curve is used to smoothly connect these connection points to the audio response curve. This improves the smoothness and accuracy of the audio response curve in a web environment, achieving precise simulation of the curve's shape. This allows users to more intuitively and accurately identify the shape of the audio response curve and makes it easier for them to make more precise adjustments. Furthermore, by directly mapping the parameters of the Gaussian function to the Web Audio API, the computational burden is reduced and the real-time performance of audio processing is improved when generating audio processed by the audio response curve on a web page.
[0090] Based on the same inventive concept, this application also provides an electronic device, which can be a server, desktop computing device, or mobile computing device (e.g., laptop computing device, handheld computing device, tablet computer, netbook, etc.). The device includes one or more processors and a memory, wherein the processor is used to execute a program to implement the Web-based audio response curve modeling method of this invention; the memory is used to store computer programs executable by the processor.
[0091] Based on the same inventive concept, this application also provides a computer-readable storage medium corresponding to the aforementioned embodiment of an audio response curve modeling method based on a Web environment. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the audio response curve modeling method based on a Web environment described in any of the above embodiments.
[0092] This application may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information may be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0093] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and the present invention also intends to include these modifications and variations.
Claims
1. A method for modeling audio response curves based on a Web environment, characterized in that: Includes the following steps: S1: Generate frequency and gain based on screen click events, and form control points by user input of Q values; or obtain the three parameters of frequency, gain, and Q value input by the user to form control points; S2: Convert the frequency, gain, and Q value of the control points into parameters of a Gaussian function and generate connection points through the Gaussian function. After smoothing the connection points with a Bézier curve, draw the audio response curve on the web. Specifically, this includes: S21: Converting the frequency, gain, and Q value of the control points into parameters μ, A, and σ of a Gaussian function, where μ represents the axis of symmetry of the Gaussian function, A represents the amplitude of the Gaussian function, and σ represents the standard deviation of the Gaussian function; S22: Selecting feature points on the Gaussian curve corresponding to the Gaussian function as connection points; S23: Smoothing the connection points and the original audio response curve with a Bézier curve to generate the audio response curve; When there are multiple control points, the gains of the overlapping frequency parts of multiple Gaussian functions are superimposed to generate the total gain of the corresponding frequency to form a new connection point; Specifically, for the j-th control point Its frequency Gain at Calculated using the following formula: in: Indicates the current frequency The octave distance between the center frequency fj of the control point and the control point. To avoid =0 caused a logarithmic calculation error; This represents the bandwidth determined by the Q value. Used to ensure that the Q value is not 0; Indicates frequency The degree of normalization off-center frequency; S represents the global scaling factor; Gj represents the control point. Maximum gain; at frequency The total gain at that frequency is the linear superposition of the gains of all control points at that frequency, i.e.: When smoothly connecting various connection points and the original audio response curve using Bézier curves, the frequency of the connection point is used as the horizontal axis and the total gain at the frequency is used as the vertical axis to form a new connection point. This new connection point is then used as the anchor point for smoothing the connection using Bézier curves.
2. The method for modeling audio response curves based on a Web environment according to claim 1, characterized in that: In step S21, the μ value of the Gaussian function corresponding to the control point is equal to the value of the frequency; the A value of the Gaussian function corresponding to the control point is equal to the value of the gain; the σ value of the Gaussian function corresponding to the control point is determined by the Q value and calculated using the following formula: Where f represents the numerical value of the frequency.
3. The method for modeling audio response curves based on a Web environment according to claim 2, characterized in that: The feature points on the Gaussian curve corresponding to the Gaussian function are the peak point, half-width at half-maximum (WHM), and inflection point of the Gaussian curve corresponding to the Gaussian function.
4. The method for modeling audio response curves based on a Web environment according to claim 3, characterized in that: Step S2 further includes: S24: sampling the audio response curve at a certain frequency interval to obtain multiple discrete sampling points; S25: plotting a visualized audio response curve on the Web based on the frequency and gain of each sampling point.
5. The method for modeling audio response curves based on a Web environment according to claim 1, characterized in that: It also includes step S3: mapping the parameters of the Gaussian function to the parameters of the Web Audio API and processing them with a DSP algorithm to obtain a digital audio signal, and converting the digital audio signal into an analog audio signal that can be played by a speaker.
6. The method for modeling audio response curves based on a Web environment according to claim 5, characterized in that: In step S3, the parameters μ, A, and σ of the Gaussian function are directly mapped to the three parameters frequency, gain, and Q of the BiquadFilterNode in the Web Audio API. The frequency of each BiquadFilterNode is the μ of its corresponding Gaussian function, and the gain is the A of its corresponding Gaussian function. Q is calculated using the following formula: 。 7. A Web-based audio response curve modeling system, characterized in that: include: The user interaction module is used to generate frequency and gain based on screen click events, and the user inputs the Q value to form control points; Alternatively, the three parameters input by the user—frequency, gain, and Q value—can be used to form control points. The curve plotting module is used to convert the frequency, gain, and Q value of control points into parameters of a Gaussian function, generate connection points using the Gaussian function, smooth the connection points using a Bézier curve, and then plot the audio response curve on the web interface. Specifically, it includes: S21: Converting the frequency, gain, and Q value of control points into parameters μ, A, and σ of a Gaussian function, where μ represents the axis of symmetry of the Gaussian function, A represents the amplitude of the Gaussian function, and σ represents the standard deviation of the Gaussian function; S22: Selecting feature points on the corresponding Gaussian curve as connection points; S23: Smoothing the connection points and the original audio response curve using a Bézier curve to generate the audio response curve; when there are multiple control points, the gains of the overlapping frequency portions of multiple Gaussian functions are superimposed to generate the total gain at the corresponding frequency, forming a new connection point; specifically, for the j-th control point... Its frequency Gain at Calculated using the following formula: in: Indicates the current frequency The octave distance between the center frequency fj of the control point and the control point. To avoid =0 caused a logarithmic calculation error; This represents the bandwidth determined by the Q value. Used to ensure that the Q value is not 0; Indicates frequency The degree of normalization off-center frequency; S represents the global scaling factor; Gj represents the control point. Maximum gain; at frequency The total gain at that frequency is the linear superposition of the gains of all control points at that frequency, i.e.: When smoothly connecting various connection points and the original audio response curve using Bézier curves, the frequency of the connection point is used as the horizontal axis and the total gain at the frequency is used as the vertical axis to form a new connection point. This new connection point is then used as the anchor point for smoothing the connection using Bézier curves.
8. The audio response curve modeling system based on a Web environment according to claim 7, characterized in that: The curve plotting module includes: a Gaussian function calculation unit, used to convert the frequency, gain, and Q value corresponding to the control point into Gaussian function parameters μ, A, and σ; the μ value of the Gaussian function corresponding to the control point is equal to the value of the frequency; the A value of the Gaussian function corresponding to the control point is equal to the value of the gain; the σ value of the Gaussian function corresponding to the control point is determined by the Q value and calculated using the following formula: , where f represents the numerical value of the frequency; the connection point generation unit is used to select feature points on the Gaussian curve corresponding to the Gaussian function as connection points; the feature points on the Gaussian curve corresponding to the Gaussian function are the peak point, half-width point and inflection point on the Gaussian curve corresponding to the Gaussian function; the curve smoothing unit is used to smoothly connect the connection points and the original audio response curve through the Bezier curve to generate an audio response curve.
Citation Information
Patent Citations
Method of standard feature descriptor technology based on robustness overlapping
CN111985509A
Sound wave simulation method and device based on Bezier curve fitting
CN120234939A