A sound pitch changing method, electronic device and computer readable storage medium

By obtaining the pitch period position, frame processing and window function synthesis in the speech pitch modification algorithm, and combining the time length factor for sampling processing, the problems of large calculation amount and unnatural effect in the existing technology are solved, and natural and high-quality speech is achieved Modified, suitable for embedded device deployment.

CN112309425BActive Publication Date: 2024-08-30ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011098110.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-14
Publication Date
2024-08-30
Estimated Expiration
2040-10-14

AI Technical Summary

Technical Problem

The existing voice pitch modification algorithm requires a large amount of calculation and the pitch modification effect is unnatural, resulting in low audio quality after pitch modification, and is not suitable for deployment on embedded devices.

Method used

By obtaining the pitch period position, the audio is processed in frames, using window functions to window and synthesize frames, controlling the overlap length between frames, combined with the time length change factor for down-sampling or up-sampling, and using low-pass filters to optimize the audio Signal.

Benefits of technology

It achieves natural and high-quality voice pitch-changing effects, reduces computational complexity, and is suitable for embedded device deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112309425B
    Figure CN112309425B
Patent Text Reader

Abstract

The present invention provides a method for sound pitch shifting, an electronic device and a computer-readable storage medium, the method comprising: obtaining the position of a pitch period in an audio to be processed; dividing the audio to be processed into frames according to the position of the pitch period to form a plurality of audio frames; performing windowing processing on the audio frames using a window function to obtain a plurality of analysis frames; synthesizing the plurality of analysis frames to obtain a synthesized audio by controlling the overlapping length between the analysis frames, and synthesizing the window functions corresponding to the analysis frames to obtain a synthesis window; processing the synthesized audio using the synthesis window to obtain a final audio after the sound is pitch shifted. The final audio obtained by the method of the present invention has a natural sound pitch shifting effect and high quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of audio signal processing, and in particular to a sound pitch changing method, electronic equipment and storage medium. Background Art

[0002] With the development of information technology and multimedia technology, people's spare time is becoming more and more colorful, and the requirements for some audio materials are getting higher and higher. Ordinary audio materials can no longer meet people's production and life needs. Voice pitch changing technology has emerged. In real life, its uses can be seen everywhere. For example, it can change a person's voice so that people who are familiar with it can't tell whose voice it is, which plays a role in protecting personal privacy. It is very useful in security, such as voice changing doorbells, smart buildings and camera intercoms.

[0003] There are many different pitch shifting algorithms available, and the mainstream pitch shifting algorithms mostly use SOLA, PSOLA, WSOLA and phase vocoder technology. Some of these algorithms perform calculations in the time domain, while others perform calculations in the frequency domain. The main problems they have are large computational complexity, unnatural pitch shifting effects, and low audio quality after pitch shifting, making them unsuitable for deployment on embedded devices. Summary of the invention

[0004] The present invention provides a sound pitch change method, an electronic device and a computer-readable storage medium, which have natural sound pitch change effects and high quality.

[0005] To solve the above technical problems, the first technical solution provided by the present invention is: to provide a sound pitch shifting method, the method comprising: obtaining the position of the pitch period in the audio to be processed; dividing the audio to be processed into frames according to the position of the pitch period to form multiple audio frames; performing windowing processing on the audio frames using a window function to obtain multiple analysis frames; controlling the overlapping length between the analysis frames, thereby synthesizing the multiple analysis frames to obtain a synthesized audio, and synthesizing the window functions corresponding to the analysis frames to obtain a synthesized window; and processing the synthesized audio using the synthesized window to obtain the final audio after the sound is pitch shifted.

[0006] Among them, the method of obtaining the position of the pitch period in the audio to be processed includes: performing differential calculation on the audio to be processed to obtain a first audio signal to be processed; performing a first zero-frequency suppression process on the first audio signal to be processed to obtain a second audio signal to be processed; performing a second zero-frequency suppression process on the second audio signal to be processed to obtain a third audio signal to be processed; performing a trend elimination process on the third audio signal to be processed to obtain a fourth audio signal to be processed; and obtaining the position of the pitch period based on the fourth audio signal to be processed.

[0007] Among them, the differential calculation of the audio to be processed to obtain the first audio signal to be processed includes: obtaining pulse code modulation data of the audio to be processed, and converting the integer data corresponding to each sample point into floating-point data; intercepting samples of a fixed length as operation objects; and performing differential calculation on the floating-point data corresponding to each sample point in the operation object to obtain the first audio signal to be processed.

[0008] Among them, the first zero-frequency suppression processing and / or the second zero-frequency suppression processing are performed on the first audio signal to be processed and / or the second audio signal to be processed by using a zero-frequency container; the trend elimination processing is performed on the third audio signal to be processed to obtain the fourth audio signal to be processed, including: using the data corresponding to the current sample point in the third audio signal to be processed minus the average value of the short-time window to perform trend elimination processing, so as to obtain the fourth audio signal to be processed.

[0009] Among them, each of the audio frames includes multiple pitch periods, and the number of samples between two adjacent pitch periods is a sliding window; the windowing processing of the audio frame using a window function to obtain multiple analysis frames includes: adding a window function of a preset length to the sliding window in each of the audio frames to obtain an analysis frame corresponding to each audio frame.

[0010] Among them, the method of controlling the overlapping length between the analysis frames to synthesize multiple analysis frames to obtain synthetic audio, and synthesizing the window functions corresponding to the analysis frames to obtain a synthetic window includes: synthesizing the current analysis frame with the currently synthesized analysis frame according to a target synthesis length based on the current synthesis length, so that the synthesized length is the target synthesis length; wherein the length of the synthesis window is equal to the length of the synthetic audio.

[0011] The method further includes: obtaining a time length variation factor, and obtaining a total target length of the sound modulation based on the time length variation factor; and setting a target synthesis length for each synthesis according to the total target length.

[0012] Among them, the synthesizing the current analysis frame with the currently synthesized analysis frame according to the target synthesis length based on the current synthesis length so that the synthesized length is the target synthesis length includes: judging the relationship between the current synthesis length and the target synthesis length; if the current synthesis length is less than the target synthesis length, synthesizing the current analysis frame by offsetting the first sliding window of the previous analysis frame of the current analysis frame on the basis of the current synthesis length.

[0013] Among them, the processing of the synthesized audio using the synthesis window to obtain the final audio after the sound is pitch-shifted also includes: judging the time length change factor; if the time length change factor is greater than a preset value, down-sampling the synthesized audio to obtain the final audio after the sound is pitch-shifted; if the time length change factor is less than the preset value, up-sampling the synthesized audio to obtain the final audio after the sound is pitch-shifted.

[0014] Among them, if the time length change factor is greater than a preset value, the synthesized audio is down-sampled to obtain the final audio after the sound is pitch-shifted, including: if the time length change factor is greater than the preset value, the synthesized audio is processed by a low-pass filter, and the processed synthesized audio is down-sampled to obtain the final audio after the sound is pitch-shifted; if the time length change factor is less than the preset value, the synthesized audio is up-sampled to obtain the final audio after the sound is pitch-shifted, including: if the time length change factor is less than the preset value, the synthesized audio is up-sampled, and the synthesized audio after the up-sampled processing is processed by a low-pass filter to obtain the final audio after the sound is pitch-shifted.

[0015] To solve the above technical problems, the second technical solution provided by the present invention is: to provide an electronic device, comprising: a memory and a processor, wherein the memory stores program instructions, and the processor calls the program instructions from the memory to execute any of the above-mentioned sound pitch changing methods.

[0016] In order to solve the above technical problems, the second technical solution provided by the present invention is: providing a computer-readable storage medium storing a program file, wherein the program file can be executed to implement any of the above-mentioned sound pitch shifting methods.

[0017] The beneficial effect of the present invention is different from the prior art. The present invention controls the overlapping length between analysis frames, synthesizes multiple analysis frames to obtain synthesized audio, and synthesizes the window functions corresponding to the analysis frames to obtain a synthesized window; and uses the synthesized window to process the synthesized audio to obtain the final audio after the sound is modulated. The final audio obtained in this way has a natural sound modulation effect and high quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work, among which:

[0019] Figure 1 is a flow chart of a first embodiment of a method for tone shifting of a sound according to the present invention;

[0020] Figure 2 is a flow chart of an embodiment of step S11;

[0021] Figure 3 is a flow chart of an embodiment of step S12;

[0022] Figure 4 is a flow chart of another embodiment of step S12;

[0023] Figure 5 is a flow chart of an embodiment of step S13;

[0024] Figure 6 is a flow chart of an embodiment of step S14;

[0025] Figure 7 is a flow chart of an embodiment of step S15;

[0026] Figure 8 It is a structural schematic diagram of an embodiment of an electronic device of the present invention;

[0027] Fig. 9 It is a schematic diagram of the structure of an embodiment of a computer-readable storage medium of the present invention. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0029] In the prior art, a certain error will be generated when performing pitch search, and the error will be amplified, which will lead to inaccurate waveform splicing. The waveform similarity is calculated using an autocorrelation function for different time periods, which increases the calculation cost. In addition, when the waveform is cut and trimmed, although a smooth transition is performed by windowing, there will still be a certain degree of noise. For example, when pitch detection is achieved through dynamic search, it is easy to generate burrs and cause mutations in the spectrum when the waveform is inserted and cut, resulting in low quality of the generated speed-changing speech. Therefore, based on the above-mentioned shortcomings, the present invention provides a method with low computational complexity and good voice changing effect. The present invention is described in detail below in conjunction with the accompanying drawings and embodiments.

[0030] See also Figure 1 , is a flow chart of a first embodiment of a method for tone shifting of a sound according to the present invention, comprising:

[0031] Step S11: the step is to obtain the position of the pitch period in the audio to be processed.

[0032] Specifically, a segment of audio data is obtained as the audio to be processed, and the pitch period position in the audio to be processed is obtained. In one embodiment, when obtaining the pitch period, it is necessary to first obtain the pulse code modulation data of the audio to be processed. The pulse code modulation data is to transform a time-continuous and value-continuous analog signal into a time-discrete and value-discrete digital signal and then transmit it in the channel. Pulse code modulation is the process of sampling the analog signal first, then quantizing the sample value amplitude, and encoding it. The acquired pulse code modulation data contains multiple sample points, and each sample point has its corresponding integer value. In one embodiment, in order to facilitate processing, the integer value corresponding to each sample point is normalized and converted into floating-point data. Based on the floating-point data, a fixed-length sample point is intercepted as an operation object. Specifically, if the entire segment of the audio to be processed needs to be processed, it can be intercepted without interception, and all the sample points in the data to be processed are used as the operation object; if only part of the audio to be processed needs to be modulated, after converting it into floating-point data, a fixed-length sample point is intercepted as the operation object.

[0033] In one embodiment, in order to accurately obtain the position of the pitch period, it is necessary to eliminate the influence of the low-frequency signal and the vocal tract model. For details, see Figure 2 ,include:

[0034] Step S111: performing differential calculation on the audio signal to be processed to obtain a first audio signal to be processed.

[0035] It is understandable that if the entire audio to be processed is a sound pitch-shifting object, the floating-point data of each sample point corresponding to the audio to be processed is differentially calculated. If a certain section of the audio to be processed is a sound pitch-shifting object, the floating-point data of the sample points of the intercepted fixed length are differentially calculated to obtain the first audio signal to be processed. Specifically, taking the sample points of the intercepted fixed length as an example, each sample point is differentially calculated one by one, and then a plurality of differential calculation results are obtained, and the plurality of differential calculation results form the first audio signal to be processed.

[0036] Specifically, the difference calculation can be performed using the following formula:

[0037] x[n]=s[n]-s[n-1] (1).

[0038] Among them, s[n] represents the floating-point value corresponding to the n-th sample point, s[n-1] represents the floating-point value corresponding to the n-1-th sample point, and x[n] represents the result of the difference calculation between the floating-point values ​​of the n-th sample point and the n-1-th sample point.

[0039] After each sample point is subjected to differential calculation in the manner of the above formula (1), a first audio signal to be processed is formed.

[0040] Step S112: performing a first zero-frequency suppression process on the first audio signal to be processed to obtain a second audio signal to be processed.

[0041] Specifically, the first zero-frequency suppression process is performed on the first audio signal to be processed to obtain the second audio signal to be processed, that is, the result after each sample point difference calculation is passed through the first zero-frequency container to obtain the second audio signal to be processed.

[0042] The first zero-frequency containment device performs the first zero-frequency suppression process as follows:

[0043]

[0044] Among them, y1[n] is the result obtained after the nth sample point passes through the first zero-frequency container, a k is the parameter of the first zero-frequency container, y1[nk] is the result obtained after the k-th sample point before the n-th sample point passes through the first zero-frequency container, and x[n] represents the result of the difference calculation between the floating-point values ​​of the n-th sample point and the n-1-th sample point.

[0045] All the samples in the first audio signal to be processed are subjected to a first zero-frequency suppression process using the above formula (2) to form a second audio signal to be processed.

[0046] Step S113: performing a second zero-frequency suppression process on the second audio signal to be processed to obtain a third audio signal to be processed.

[0047] Specifically, the second audio signal to be processed is subjected to the second zero-frequency suppression process to obtain the third audio signal to be processed, that is, each sample point in the second audio signal to be processed passes through the second zero-frequency container to obtain the third audio signal to be processed.

[0048] The second zero-frequency containment device performs the second zero-frequency suppression process as follows:

[0049]

[0050] Among them, y1[n] is the result obtained after the nth sample point passes through the first zero-frequency container, a k is the parameter of the first zero-frequency container, y2[nk] is the result obtained after the k-th sample point before the n-th sample point passes through the second zero-frequency container, and y2[n] represents the result obtained after the n-th sample point passes through the second zero-frequency container.

[0051] All the samples in the second audio signal to be processed are subjected to a second zero-frequency suppression process using the above formula (3) to form a third audio signal to be processed.

[0052] Step S114: performing trend elimination processing on the third audio signal to be processed to obtain a fourth audio signal to be processed.

[0053] Specifically, the signal obtained after the zero-frequency container performs zero-frequency suppression processing is an exponentially growing or decaying signal, which needs to be stabilized above and below the coordinate axis, so the third-generation processed audio signal needs to be subjected to trend elimination processing. Specifically, the data corresponding to the current sample point in the third audio signal to be processed is subtracted from the average value of the short-time window to perform trend elimination processing, thereby obtaining the fourth audio signal to be processed.

[0054]

[0055] Among them, y2[n] represents the result obtained after the nth sample point passes through the second zero-frequency container, y2[n+m] represents the result obtained after the mth sample point after the nth sample point passes through the second zero-frequency container, and y[n] is the result of the nth sample point after trend elimination.

[0056] Each sample point in the third audio signal to be processed is subjected to trend elimination using the above formula (4) to form a fourth audio signal to be processed.

[0057] Step S115: acquiring the position of the pitch period based on the fourth audio signal to be processed.

[0058] Specifically, the fourth audio signal to be processed obtained after trend elimination is an oscillating waveform, and its local period is approximately equal to the local pulse period. Therefore, the zero-crossing point from negative to positive is extracted from the signal after trend elimination to determine the position of the pitch period.

[0059] Step S12: dividing the audio to be processed into frames according to the position of the pitch period to form a plurality of audio frames.

[0060] The audio to be processed is divided into frames according to the position of the pitch period to form multiple audio frames. Specifically, the position of the pitch period extracted in step S11 is multiple, and the number of sample points between two adjacent pitch periods is a sliding window. For details, please refer to Figure 3 Assuming that step S11 extracts 6 pitch period positions, then Figure 3 There is a sliding window between pitch period 1 and pitch period 2, which contains multiple sample points; there is a sliding window between pitch period 2 and pitch period 3; there is a sliding window between pitch period 3 and pitch period 4; there is a sliding window between pitch period 4 and pitch period 5; there is a sliding window between pitch period 5 and pitch period 6.

[0061] according to Figure 3The pitch period shown in the figure divides the audio data into frames to obtain multiple audio frames. An audio frame can contain multiple pitch periods. For example, an audio frame is formed by 4 pitch periods (3 sliding windows). Figure 4 , pitch period 1, pitch period 2, pitch period 3 and pitch period 4 form an audio frame; pitch period 2, pitch period 3, pitch period 4 and pitch period 5 form an audio frame; pitch period 3, pitch period 4, pitch period 5 and pitch period 6 form an audio frame.

[0062] Step S13: Perform windowing processing on the audio frame using a window function to obtain multiple analysis frames.

[0063] Specifically, the sliding window in each of the audio frames is added with a window function of a preset length to obtain an analysis frame corresponding to each audio frame, see Figure 5 , add a window function of the length of the sliding window corresponding to the audio frame to each audio frame, and then convert the audio frame into an analysis frame. Specifically, take pitch period 1, pitch period 2, pitch period 3 and pitch period 4 to form an audio frame as an example, wherein the audio frame includes sliding windows Hop1, Hop2, and Hop3, then use the window function to add a window function of the total length of sliding windows Hop1, Hop2, and Hop3 to the audio frame, and then convert the audio frame into an analysis frame.

[0064] In this embodiment, since every n adjacent sliding windows constitute an analysis frame, the length of the sum of the last n-1 sliding windows of the sequence will not be processed, and its pitch period position and the corresponding sequence data will be retained and connected with the next subsequence for processing.

[0065] like Figure 5 As shown, the offset between two adjacent analysis frames is the length of the first sliding window of the previous analysis frame. For example, the offset between analysis frame 1 and analysis frame 2 is the length of the first sliding window Hop1 of analysis frame 1, and the offset between analysis frame 2 and analysis frame 2 is the length of the first sliding window Hop2 of analysis frame 2.

[0066] Step S14: by controlling the overlapping length between the analysis frames, multiple analysis frames are synthesized to obtain a synthesized audio, and the window functions corresponding to the analysis frames are synthesized to obtain a synthesized window.

[0067] Specifically, the present application controls the overlapping length between analysis frames, thereby synthesizing multiple analysis frames to obtain synthesized audio, and synthesizes the window functions corresponding to the analysis frames to obtain a synthetic window, thereby achieving the purpose of signal time length expansion.

[0068] Specifically, the initial target length and the initial synthesis length are set to 0. When synthesizing for the first time, the target synthesis length is set, and the analysis frame 1 is synthesized based on the initial synthesis length, and the synthesis length reaches the target synthesis length; then based on the current synthesis length, the current analysis frame is synthesized with the currently synthesized analysis frame according to the target synthesis length, so that the synthesized length is the target synthesis length. The length of the synthesis window is equal to the length of the synthesized audio.

[0069] For example, if the current synthesis length is 5s and the target synthesis length is 10s, the current analysis frame is synthesized by 5s on the basis of the current synthesis length of 5s, so that the synthesized length reaches the target synthesis length of 10s; when the next synthesis is performed, when the target synthesis length is 13s, the next analysis frame is synthesized by 3s on the basis of the current synthesis length of 10s, so that the synthesized length reaches the target synthesis length of 13s.

[0070] In one embodiment, when setting the target synthesis length, the time length variation factor can be combined to obtain the total target length of the sound modulation based on the time length variation factor. Specifically, the time length variation factor is used to characterize whether the duration of the current audio to be processed is stretched or shortened. The target synthesis length of each synthesis is set according to the total target length. Specifically, when setting the target synthesis length of each synthesis, the number of analysis frames can also be considered.

[0071] In one embodiment, please refer to Figure 6 The analysis frames are superimposed in a manner including:

[0072] Step S61: Determine the relationship between the current synthesis length and the target synthesis length.

[0073] Specifically, it is determined whether the current synthesis length is greater than the target synthesis length.

[0074] Step S62: if the current synthesis length is less than the target synthesis length, the current analysis frame is synthesized by offsetting the first sliding window of the previous analysis frame of the current analysis frame on the basis of the current synthesis length.

[0075] In one embodiment, if the current synthesis length is 10s and the target synthesis length is 13s, the current synthesis length is smaller than the target synthesis length. In this case, the current analysis frame is synthesized by offsetting the first sliding window of the previous analysis frame of the current analysis frame based on the current synthesis length.

[0076] Step S63: If the current synthesis length is greater than the target synthesis length, select the next analysis frame, set the next target synthesis length, and return to step S61.

[0077] Specifically, if the current synthesis length is 13s and the target synthesis length is 10s, the current synthesis length is greater than the target synthesis length. At this time, the current analysis frame is not synthesized, and the next analysis frame of the current analysis frame is selected. Then, the next target synthesis length is set, and it is determined whether the target synthesis length is greater than the current target synthesis length. If so, the next analysis frame of the current analysis frame is synthesized.

[0078] It should be noted that when synthesizing the analysis frame, the window function needs to be synthesized in the same manner, and the position where the window function is overlapped is the same as the position where the analysis frame is overlapped.

[0079] Step S15: Processing the synthesized audio using a synthesis window to obtain a final audio with the sound shifted.

[0080] Specifically, the synthesized audio is divided by the synthesis window at the corresponding superposition position to obtain the final audio after the sound is shifted.

[0081] In one embodiment, see Figure 7 , step S15 further includes:

[0082] Step S71: Determine the time length change factor.

[0083] Specifically, by judging the time length change factor, it is determined whether the result of the sound pitch change is to stretch or shorten the time length of the audio to be processed.

[0084] Step S72: If the time length variation factor is greater than a preset value, down-sampling is performed on the synthesized audio to obtain a final audio with the sound pitch changed.

[0085] Specifically, the preset value is 1. If the time length change factor is greater than 1, it means that the time length of the audio to be processed needs to be stretched. At this time, the synthesized audio is downsampled to obtain the final audio after the sound is changed.

[0086] In one embodiment, in order to prevent aliasing from occurring during downsampling, the synthesized audio is first processed using a low-pass filter, and then the processed synthesized audio is downsampled to obtain a final audio after the sound is modulated.

[0087] Step S73: If the time length variation factor is less than a preset value, up-sampling is performed on the synthesized audio to obtain a final audio with the sound pitch shifted.

[0088] If the time length change factor is less than 1, it means that the time length of the audio to be processed needs to be shortened. At this time, the synthesized audio is upsampled to obtain the final audio after the sound is shifted.

[0089] In one embodiment, in order to prevent the occurrence of a mirror image phenomenon during upsampling, the synthesized audio is first upsampled, and then the upsampled synthesized audio is processed using a low-pass filter to obtain a final audio after the sound is shifted.

[0090] The sound pitch-shifting method provided by the present invention eliminates low-frequency signals and counteracts the influence of the vocal tract by differential calculation, first zero-frequency suppression processing, second zero-frequency suppression processing, and trend elimination processing when obtaining the position of the pitch period, thereby realizing accurate extraction of the pitch period. And in the analysis frame synthesis stage, the purpose of signal expansion and contraction is realized by controlling the overlap length between the analysis frames. The final audio sound pitch-shifting effect obtained by the method of the present invention is natural and of high quality, and in the present application, the amount of calculation involved is small.

[0091] See also Figure 8 , is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. The electronic device includes a memory 202 and a processor 201 connected to each other.

[0092] The memory 202 is used to store program instructions for implementing any of the above-mentioned methods for changing the sound pitch of the device.

[0093] The processor 201 is used to execute program instructions stored in the memory 202 .

[0094] The processor 201 may also be referred to as a CPU (Central Processing Unit). The processor 201 may be an integrated circuit chip having signal processing capabilities. The processor 201 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0095] The memory 202 can be a memory stick, a TF card, etc., which can store all the information in the electronic device of the device, including the input raw data, computer programs, intermediate operation results and final operation results are all stored in the memory. It stores and retrieves information according to the location specified by the controller. Only with the memory can the electronic device have a memory function and ensure normal operation. The memory of the electronic device can be divided into main memory (internal memory) and auxiliary memory (external memory) according to its use. There is also a classification method of dividing it into external memory and internal memory. External memory is usually a magnetic medium or an optical disk, etc., which can store information for a long time. Memory refers to the storage component on the motherboard, which is used to store the data and programs currently being executed, but it is only used to temporarily store programs and data. If the power is turned off or the power is cut off, the data will be lost.

[0096] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0097] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0098] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0099] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a system server, or a network device, etc.) or a processor to execute all or part of the steps of the various implementation methods of the present application.

[0100] See also Fig. 9, is a structural diagram of a computer-readable storage medium of the present invention. The storage medium of the present application stores a program file 203 that can implement all the above-mentioned sound tone-shifting methods, wherein the program file 203 can be stored in the above-mentioned storage medium in the form of a software product, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage device includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, or terminal devices such as a computer, a server, a mobile phone, and a tablet.

[0101] The above are only implementation modes of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for changing the pitch of a sound, characterized in that: The method comprises: Get the position of the pitch period in the audio to be processed; Dividing the audio to be processed into frames according to the position of the pitch period to form a plurality of audio frames; Performing windowing processing on the audio frame using a window function to obtain a plurality of analysis frames; By controlling the overlapping length between the analysis frames, a plurality of the analysis frames are synthesized to obtain a synthesized audio, and the window functions corresponding to the analysis frames are synthesized to obtain a synthesized window; Processing the synthesized audio using the synthesis window to obtain a final audio with a pitch-shifted sound; The step of obtaining the position of the pitch period in the audio to be processed comprises: Performing differential calculation on the audio signal to be processed to obtain a first audio signal to be processed; Performing a first zero-frequency suppression process on the first audio signal to be processed to obtain a second audio signal to be processed; performing a second zero-frequency suppression process on the second audio signal to be processed to obtain a third audio signal to be processed; Performing trend elimination processing on the third audio signal to be processed to obtain a fourth audio signal to be processed; Acquire the position of the pitch period based on the fourth audio signal to be processed; Using a zero-frequency container to perform a first zero-frequency suppression process and / or a second zero-frequency suppression process on the first audio signal to be processed and / or the second audio signal to be processed; The performing trend elimination processing on the third audio signal to be processed to obtain a fourth audio signal to be processed comprises: Using data corresponding to the current sample point in the third audio signal to be processed minus the average value of the short-time window to perform trend elimination processing, thereby obtaining a fourth audio signal to be processed; The method of controlling the overlap length between the analysis frames to synthesize a plurality of the analysis frames to obtain a synthesized audio, and synthesizing the window functions corresponding to the analysis frames to obtain a synthesized window comprises: Based on the current synthesis length, synthesize the current analysis frame with the currently synthesized analysis frame according to the target synthesis length, so that the synthesized length is the target synthesis length; The length of the synthesis window is equal to the length of the synthesized audio.

2. The method for tone shifting according to claim 1, characterized in that: The performing differential calculation on the audio signal to be processed to obtain a first audio signal to be processed includes: Acquire the pulse code modulation data of the audio to be processed, and convert the integer data corresponding to each sample point into floating point data; Cut off the sample points of fixed length as the operation object; Performing differential calculation on the floating-point data corresponding to each sample point in the operation object to obtain the first audio signal to be processed.

3. The method for voice pitch change according to claim 1, characterized in that: Each of the audio frames includes a plurality of pitch periods, and the number of sample points between two adjacent pitch periods is a sliding window; The step of performing windowing processing on the audio frame using a window function to obtain a plurality of analysis frames comprises: A window function of a preset length is added to the sliding window in each of the audio frames to obtain an analysis frame corresponding to each audio frame.

4. The method for tone shifting according to claim 1, characterized in that: The method further comprises: Acquire a time length variation factor, and obtain a total target length of the sound pitch change based on the time length variation factor; The target synthesis length of each synthesis is set according to the total target length.

5. The method for voice pitch change according to claim 1, characterized in that: The synthesizing the current analysis frame with the currently synthesized analysis frame according to the target synthesis length based on the current synthesis length so that the synthesized length is the target synthesis length includes: Determine the relationship between the current composite length and the target composite length; If the current synthesis length is less than the target synthesis length, the current analysis frame is synthesized by offsetting the first sliding window of the previous analysis frame of the current analysis frame on the basis of the current synthesis length.

6. The method for voice pitch change according to claim 1, characterized in that: The step of processing the synthesized audio using the synthesis window to obtain a final audio after the sound is modulated also includes: Determine the time length change factor; If the time length variation factor is greater than a preset value, downsampling the synthesized audio to obtain a final audio with a pitch-shifted sound; If the time length variation factor is less than a preset value, up-sampling is performed on the synthesized audio to obtain a final audio with the sound pitch changed.

7. The method for tone changing of a sound according to claim 6, characterized in that: If the time length variation factor is greater than a preset value, downsampling the synthesized audio to obtain a final audio with a pitch-shifted sound includes: If the time length variation factor is greater than a preset value, the synthesized audio is processed by using a low-pass filter, and then the processed synthesized audio is down-sampled to obtain a final audio with a changed tone; If the time length variation factor is less than a preset value, up-sampling the synthesized audio to obtain a final audio with a pitch-shifted sound includes: If the time length variation factor is less than a preset value, the synthesized audio is upsampled, and then the upsampled synthesized audio is processed using a low-pass filter to obtain a final audio with a pitch-shifted sound.

8. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the sound pitch change method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: A program file is stored, and the program file can be executed to implement the sound pitch change method as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Apparatus, method and computer program for obtaining a parameter describing a variation of a signal characteristic of a signal

    EP2211335A1

  • Method and device for processing signal containing voice

    JP2010210758A