A method for converting audio to chord tone

By performing spectrum decomposition and mapping processing on the audio signal, the problems of complexity of chord tone conversion and poor tone controllability in the existing technology are solved, and efficient conversion of complex format audio files to chord tones is achieved.

CN113990336BActive Publication Date: 2025-09-30SHENZHEN ZHENBANG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111241631.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-25
Publication Date
2025-09-30
Estimated Expiration
2041-10-25

AI Technical Summary

Technical Problem

In the prior art, chord tones are mainly produced by dragging the sound, which has a single tone and poor controllability of the sound volume, and is unable to convert audio files in complex formats into chord tones.

Method used

The audio signal is subjected to spectral decomposition, bandpass filtering, and short-time Fourier decomposition, mapped to the frequency and amplitude of the buzzer, and converted into the driving frequency and voltage of the PWM generator to achieve the conversion of the audio signal into chord tone.

Benefits of technology

It achieves efficient conversion of complex format audio files into chord tones, avoiding the limitations of traditional methods and making the rhythm and tone highly controllable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113990336B_ABST
    Figure CN113990336B_ABST
Patent Text Reader

Abstract

The present invention is applicable to the field of audio to chord sound conversion and provides an audio to chord sound conversion method, which includes the following steps: step S1: performing spectral decomposition on an audio signal to obtain the amplitude and frequency of the audio signal; step S2: mapping the frequency and amplitude of the audio signal to the frequency and amplitude corresponding to a buzzer; the method aims to solve the technical problems that the existing technology for producing chord sounds mainly adopts a dragging sound processing method and utilizes the discharge characteristics of capacitor voltage to generate a variable driving voltage. However, in actual application, these methods have the problems of single tone, poor controllability of sound volume, too light or too soft rhythm, etc., and cannot convert audio files in complex formats such as MP3 and WAV into chord sounds.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of audio-to-chord sound conversion, and in particular relates to a method for converting audio-to-chord sound. Background Art

[0002] With the increasing popularity of smart home appliances, there is an increasing demand for intelligent, user-friendly human-computer interaction applications. A buzzer is an electronic component that generates sound based on a driving voltage and frequency. It offers advantages such as simple operation, low cost, and wide adaptability. By pre-storing a series of driving voltages and frequencies in memory, the buzzer can produce simple chordal tones. However, converting audio files in complex formats such as MP3 and WAV to the driving voltage and frequency for the buzzer is a complex process. It requires sensory analysis of each beat and the determination of the driving frequency and amplitude of the chordal tone, making the process challenging. Furthermore, it requires extensive auditioning and trial and error, making engineering applications difficult.

[0003] Existing methods for producing chord tones mainly use a dragging sound processing method, which uses the discharge characteristics of capacitor voltage to generate a variable driving voltage. However, in practical applications, these methods have the following problems, such as a single tone, poor sound volume controllability, and a rhythm that is too light or too soft. In addition, they are unable to convert audio files in complex formats such as MP3 and WAV into chord tones. Summary of the Invention

[0004] The present invention aims to provide a method for converting audio to chord tones, aiming to solve the technical problems that the existing technology mainly uses a dragging sound processing method to produce chord tones, using the discharge characteristics of capacitor voltage to generate a variable driving voltage. However, in actual application, these methods have the following technical problems: single tone, poor sound volume controllability, too light or too soft rhythm, etc., and cannot convert audio files in complex formats such as MP3 and WAV into chord tones.

[0005] The present invention is implemented as follows: a method for converting audio to chord tones, the method comprising the following steps:

[0006] Step S1: performing spectrum decomposition on the audio signal to obtain the amplitude and frequency of the audio signal;

[0007] Step S2: Mapping the frequency and amplitude of the audio signal to the frequency and amplitude corresponding to the buzzer;

[0008] Step S3: Convert the buzzer amplitude and frequency into the period value, channel 1 comparison value, and channel 2 comparison value corresponding to the PWM generator, where channel 1 is used to generate the driving frequency and channel 2 is used to generate the driving voltage, that is, convert the audio signal into the driving frequency and driving amplitude corresponding to the chord tone.

[0009] A further technical solution of the present invention is: the specific steps of performing spectrum decomposition of the audio signal in step S1 are:

[0010] Step S11: Assume that the duration of the audio signal is T x , the sampling frequency is f s , then the discretized audio signal can be represented as a one-dimensional vector x=[x1,x2…,x n ] indicates that

[0011] Step S12: performing bandpass filtering on the audio signal to filter out low-frequency and high-frequency noise signals in the audio;

[0012] Step S13: performing short-time Fourier decomposition on the filtered audio signal, and selecting the frequency and amplitude corresponding to the maximum amplitude in the spectrum.

[0013] A further technical solution of the present invention is: the specific steps of performing bandpass filtering on the audio signal in step S12 are: performing bandpass filtering on the audio signal, wherein the passband of the bandpass filter is [f min ,f max ], where f min The value of f is 100-200Hz, max The value of is 1000-1500Hz; Assume that the audio signal after filtering is y=[y1,y2…,y n ], the designed filter is

[0014] y(n)=b0x(n)+b1x(n-1)+b2x(n-1)-a1y(n-1)-a2y(n-2)

[0015] Among them, b0, b1, b2, a1, a2 are the coefficients of the filter.

[0016] A further technical solution of the present invention is: the specific steps of performing short-time Fourier decomposition on the filtered audio signal in step S13 are: performing short-time Fourier decomposition on the filtered audio signal, the transformation adopts a rectangular window, assuming that the time window length is T w ,T w The value of is generally 10-20ms, so the duration is T x The audio signal can be divided into M time windows, The number of sampling points in each time window is The audio signal of the mth time window is c m =[x ML+1 ,x ML+2 …,x ML+L ], the short-time Fourier transform is

[0017] [dm ,f m ]=FFT(c m ,f s )

[0018] where d m is the spectrum amplitude at the maximum amplitude in the spectrum, f m is the frequency corresponding to the maximum amplitude in the spectrum. After processing, the spectrum amplitude of the audio signal with a length of M is obtained [d1, d2…, d M ] and frequencies [f1,f2…,f M ].

[0019] A further technical solution of the present invention is: the specific steps of step S2 are: mapping the frequency and amplitude of the audio signal to the frequency and amplitude corresponding to the buzzer, and the specific conversion formula is:

[0020]

[0021] Among them, f′ m ,d′ m To convert the corresponding buzzer frequency and amplitude, f base is the basic frequency of the buzzer, f base 2k to 4k, k is the frequency conversion gain, k value is 3-6, g m f′ m The buzzer gain corresponding to the frequency is processed to obtain the buzzer amplitude [d′1, d′2…, d′ M ] and frequencies [f′1,f′2…,f′ M ].

[0022] A further technical solution of the present invention is: the specific steps of step S3 are: converting the buzzer amplitude and frequency into the period value p corresponding to the PWM generator m , Channel 1 comparison value e m Compare value f with channel 2 m , where channel 1 is used to generate the driving frequency and channel 2 is used to generate the driving voltage. The specific conversion formula is:

[0023]

[0024] where f clk is the main frequency of the PWM generator, and the driving voltage and driving frequency sequence [p1, p2…, p M ],[e1,e2…,e M ],[f1,f2…,f M ], after processing, the audio signal is converted into the driving frequency and driving amplitude corresponding to the chord tone.

[0025] The beneficial effects of the present invention are as follows: this audio to chord tone conversion method uses an audio signal processing method to perform a series of amplitude and frequency stretching transformations on the original audio signal according to the amplitude-frequency characteristics of the buzzer. The audio signal is first subjected to a short-time Fourier transform to obtain the amplitude and frequency of the audio signal within the time window, and the driving frequency of the chord tone is obtained through a one-to-one mapping of the frequencies. The amplitude of the audio signal is compensated according to the amplitude-frequency gain of the buzzer to obtain the driving voltage of the chord tone, and the driving voltage and driving frequency required by the buzzer are obtained accordingly. Converting chord tones by using a signal processing method does not require much musical knowledge and avoids a series of problems associated with traditional methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is a flowchart of a method for converting audio to chord tones provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0027] Figure 1 A method for converting audio to chord tones provided by the present invention is shown, and the method includes the following steps:

[0028] Step S1: performing spectrum decomposition on the audio signal to obtain the amplitude and frequency of the audio signal.

[0029] The specific steps of performing spectrum decomposition of the audio signal in step S1 are:

[0030] Step S11: Assume that the duration of the audio signal is T x , the sampling frequency is f s , then the discretized audio signal can be represented as a one-dimensional vector x=[x1,x2…,x n ] indicates that

[0031] Step S12: performing band-pass filtering on the audio signal to filter out low-frequency and high-frequency noise signals in the audio.

[0032] The specific steps of performing bandpass filtering on the audio signal in step S12 are: performing bandpass filtering on the audio signal, wherein the passband of the bandpass filter is [f min ,f max ], where f min The value of f is 100-200Hz, max The value of is 1000-1500Hz; Assume that the audio signal after filtering is y=[y1,y2…,y n ], the designed filter is

[0033] y(n)=b0x(n)+b1x(n-1)+b2x(n-1)-a1y(n-1)-a2y(n-2)

[0034] Among them, b0, b1, b2, a1, a2 are the coefficients of the filter.

[0035] Step S13: performing short-time Fourier decomposition on the filtered audio signal, and selecting the frequency and amplitude corresponding to the maximum amplitude in the spectrum.

[0036] The specific steps of performing short-time Fourier decomposition on the filtered audio signal in step S13 are as follows: performing short-time Fourier decomposition on the filtered audio signal, the transformation adopts a rectangular window, assuming that the time window length is T w ,T w The value of is generally 10-20ms, so the duration is T x The audio signal can be divided into M time windows, The number of sampling points in each time window is The audio signal of the mth time window is c m =[x ML+1 ,x ML+2 …,x ML+L ], the short-time Fourier transform is

[0037] [d m ,f m ]=FFT(c m ,f s )

[0038] where d m is the spectrum amplitude at the maximum amplitude in the spectrum, f m is the frequency corresponding to the maximum amplitude in the spectrum. After processing, the spectrum amplitude of the audio signal with a length of M is obtained [d1, d2…, d M ] and frequencies [f1,f2…,f M ].

[0039] Step S2: Map the frequency and amplitude of the audio signal to the frequency and amplitude corresponding to the buzzer.

[0040] The specific steps of step S2 are: mapping the frequency and amplitude of the audio signal to the frequency and amplitude corresponding to the buzzer. The specific conversion formula is:

[0041]

[0042] Among them, f′ m ,d′ m To convert the corresponding buzzer frequency and amplitude, f base is the basic frequency of the buzzer, f base 2k to 4k, k is the frequency conversion gain, k value is 3-6, g m f′ mThe buzzer gain corresponding to the frequency is processed to obtain the buzzer amplitude [d′1, d′2…, d′ M ] and frequencies [f′1,f′2…,f′ M ].

[0043] Step S3: Convert the buzzer amplitude and frequency into the period value, channel 1 comparison value, and channel 2 comparison value corresponding to the PWM generator, where channel 1 is used to generate the driving frequency and channel 2 is used to generate the driving voltage, that is, convert the audio signal into the driving frequency and driving amplitude corresponding to the chord tone.

[0044] The specific steps of step S3 are: converting the buzzer amplitude and frequency into the period value p corresponding to the PWM generator m , Channel 1 comparison value e m Compare value f with channel 2 m , where channel 1 is used to generate the driving frequency and channel 2 is used to generate the driving voltage. The specific conversion formula is:

[0045]

[0046] where f clk is the main frequency of the PWM generator, and the driving voltage and driving frequency sequence [p1, p2…, p M ],[e1,e2…,e M ],[f1,f2…,f M ], after processing, the audio signal is converted into the driving frequency and driving amplitude corresponding to the chord tone.

[0047] This audio-to-chord tone conversion method uses an audio signal processing method. According to the amplitude-frequency characteristics of the buzzer, the original audio signal is subjected to a series of amplitude and frequency stretching transformations. The audio signal is first subjected to a short-time Fourier transform to obtain the amplitude and frequency of the audio signal within the time window. The driving frequency of the chord tone is obtained through a one-to-one mapping of frequencies, and the amplitude of the audio signal is compensated according to the amplitude-frequency gain of the buzzer to obtain the driving voltage of the chord tone. The driving voltage and driving frequency required by the buzzer are obtained accordingly. Converting chord tones through signal processing methods does not require much musical knowledge and avoids a series of problems encountered by traditional methods.

[0048] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for converting audio to chord tones, characterized in that: The conversion method comprises the following steps: Step S1: performing spectrum decomposition on the audio signal to obtain the amplitude and frequency of the audio signal; Step S2: Mapping the frequency and amplitude of the audio signal to the frequency and amplitude corresponding to the buzzer; Step S3: Convert the buzzer amplitude and frequency into the period value, channel 1 comparison value, and channel 2 comparison value corresponding to the PWM generator, where channel 1 is used to generate the driving frequency and channel 2 is used to generate the driving voltage, that is, convert the audio signal into the driving frequency and driving amplitude corresponding to the chord tone.

2. The conversion method according to claim 1, characterized in that The specific steps of performing spectrum decomposition of the audio signal in step S1 are: Step S11: Assume that the duration of the audio signal is , the sampling frequency is , then the discretized audio signal is represented by a length of One-dimensional vector of Indicates that ; Step S12: performing bandpass filtering on the audio signal to filter out low-frequency and high-frequency noise signals in the audio; Step S13: performing short-time Fourier decomposition on the filtered audio signal, and selecting the frequency and amplitude corresponding to the maximum amplitude in the spectrum.

3. The conversion method according to claim 2, characterized in that: The specific steps of performing bandpass filtering on the audio signal in step S12 are: performing bandpass filtering on the audio signal, wherein the passband of the bandpass filter is ,in The value is 100-200Hz, The value of is 1000-1500Hz; assuming the audio signal after filtering is , the designed filter is ; in, are the coefficients of the filter.

4. The conversion method according to claim 3, characterized in that: The specific steps of performing short-time Fourier decomposition on the filtered audio signal in step S13 are: performing short-time Fourier transform on the filtered audio signal, which adopts a rectangular window, assuming that the time window length is , The value of is 10-20ms, so the duration is The audio signal is divided into time windows, , the number of sampling points in each time window is , the audio signal of the mth time window is , the short-time Fourier transform is ; in is the spectrum amplitude at the maximum amplitude in the spectrum, is the frequency corresponding to the maximum amplitude in the spectrum, and the length is obtained after processing. The spectrum amplitude of the audio signal and frequency .

5. The main steps are: map the frequency and amplitude of the audio signal to the frequency and amplitude corresponding to the buzzer. The specific conversion formula is: ; in, To convert the corresponding buzzer frequency and amplitude, is the basic frequency of the buzzer, 2k to 4k, is the frequency conversion gain, The value range is 3-6. for The buzzer gain corresponding to the frequency is processed to obtain a length of Buzzer amplitude and frequency .

Citation Information

Patent Citations

  • Chord sound output control method and system

    CN106847247A

  • Buzzer control circuit , buzzing device and smoke ventilator

    CN206163119U