Music genre conversion method and device, equipment and storage medium

By extracting the spectrum and fundamental frequency features of the converted songs, and reconstructing the spectrum features with the feature vectors of the target music genre, the dynamic conversion of the music genre is achieved, solving the problem of insufficient flexibility in the existing technology, and improving the music genre conversion effect under treatment needs.

CN119541533APending Publication Date: 2025-02-28PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411701133.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing music genre conversion technology cannot dynamically convert music genres according to the patient's treatment needs, resulting in poor flexibility.

Method used

By extracting the spectrum features and fundamental features of the converted songs, combining the feature vectors of the target music genre, reconstructing the spectrum features and mapping them into speech, realizing the dynamic conversion of the music genre.

Benefits of technology

Improves flexibility in the conversion of music genres based on patient treatment needs, so that songs to be converted can be dynamically converted into appropriate music genres according to different treatment needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119541533A_ABST
    Figure CN119541533A_ABST
Patent Text Reader

Abstract

The invention relates to an artificial intelligence technology, and discloses a music genre conversion method, which comprises the following steps of: extracting spectrum characteristics and fundamental frequency characteristics of a to-be-converted song to obtain a spectrum vector of the to-be-converted song and a fundamental frequency vector of the to-be-converted song; performing frequency spectrum feature extraction on the target music genre song to obtain a frequency spectrum feature vector of the target music genre song; performing music genre feature extraction on the target genre song spectrum feature vector by using a pre-constructed music genre classification model to obtain a target genre feature vector; reconstructing spectrum features by using the to-be-converted song spectrum vector, the to-be-converted song fundamental frequency vector and the target genre feature vector to obtain a converted song spectrum vector; and mapping the frequency spectrum vector of the converted song into voice to obtain the converted song. The invention further provides a music genre conversion device, equipment and a medium which can be used in the medical field, and the flexibility of music genre conversion based on patient treatment requirements is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of artificial intelligence technology and medical technology, and in particular to a music genre conversion method, device, electronic device and storage medium. Background Art

[0002] In the medical field, for specific medical treatments, patients need to be provided with specific types of music to promote the therapeutic effect. For example, some studies have shown that relaxing music can reduce patients' pain perception and anxiety, so using soft pop music or light music in relaxation therapy may be more effective. On the contrary, when patients need to improve their concentration and alertness, faster-paced and intense genres such as rock or electronic music may be used. However, it often happens that the music genre of the songs that patients like do not meet the requirements of the treatment, and the music genre of the songs needs to be converted.

[0003] However, current music genre conversion can often only be converted to a fixed music genre and cannot be dynamically converted according to the patient's treatment needs, resulting in poor flexibility in music genre conversion based on the patient's treatment needs. Summary of the invention

[0004] The present invention provides a music genre conversion method, device, electronic device and storage medium, the main purpose of which is to improve the flexibility of music genre conversion based on patient treatment needs.

[0005] Extract the frequency spectrum feature and fundamental frequency feature of the song to be converted, and obtain the frequency spectrum vector and fundamental frequency vector of the song to be converted;

[0006] Extracting the spectrum features of songs of the target music genre to obtain the spectrum feature vectors of the songs of the target music genre;

[0007] Using a pre-built music genre classification model, extracting music genre features from the target genre song frequency spectrum feature vector to obtain a target genre feature vector;

[0008] Reconstructing the spectrum features using the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector to obtain a spectrum vector of the converted song;

[0009] The converted song spectrum vector is mapped to speech to obtain a converted song.

[0010] Optionally, the extracting of spectrum features and fundamental frequency features of the song to be converted to obtain a spectrum vector and a fundamental frequency vector of the song to be converted includes:

[0011] Performing frame division and windowing on the song to be converted to obtain a plurality of first song speech frames;

[0012] Performing short-time Fourier transform on each of the first song speech frames to convert the time domain features of the first song speech frames into frequency domain features, thereby obtaining a first spectrum vector of each of the first song speech frames;

[0013] Performing Mel filter bank filtering on the first spectrum vector of each of the first song speech frames to obtain the first step Mel spectrum vector of each of the first song speech frames;

[0014] Performing discrete cosine transform on the first Mel-frequency spectrum vector of each of the first song speech frames to obtain a first Mel-frequency cepstral coefficient vector of each of the first song speech frames;

[0015] Extracting the fundamental frequency of the first spectrum vector of each of the first song speech frames to obtain the fundamental frequency feature value of each of the first song speech frames;

[0016] Combining all the first Mel-cepstral coefficient vectors according to the order of the corresponding first song speech frames in the song to be converted, to obtain an initial spectrum vector of the song to be converted;

[0017] Performing dimension reduction on the initial frequency spectrum vector of the song to be converted to obtain the frequency spectrum vector of the song to be converted of a preset vector dimension;

[0018] All the fundamental frequency feature values ​​are combined according to the order of the corresponding first song speech frames in the song to be converted to obtain the fundamental frequency vector of the song to be converted.

[0019] Optionally, the extracting of spectrum features and fundamental frequency features of the song to be converted to obtain a spectrum vector and a fundamental frequency vector of the song to be converted includes:

[0020] Extracting the spectrum envelope of the song to be converted to obtain an initial spectrum feature vector of the song to be converted;

[0021] Performing dimension reduction on the initial frequency spectrum vector of the song to be converted to obtain the frequency spectrum vector of the song to be converted of a preset vector dimension;

[0022] The fundamental frequency of the song to be converted is extracted to obtain the fundamental frequency vector of the song to be converted.

[0023] Optionally, the reconstructing the spectrum feature by using the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector to obtain the spectrum vector of the converted song includes:

[0024] Performing vector concatenation of the song spectrum vector to be converted, the song fundamental frequency vector to be converted, and the target genre feature vector to obtain a converted song feature vector;

[0025] The converted song feature vector is dimensionally upgraded to obtain a converted song spectrum vector having the same dimension as the initial spectrum vector of the song to be converted.

[0026] Optionally, the extracting spectrum features of songs of the target music genre to obtain spectrum feature vectors of songs of the target music genre includes:

[0027] Performing frame division and windowing on the target music genre song to obtain a plurality of second song speech frames;

[0028] Performing short-time Fourier transform on each of the second song speech frames to convert the time domain features of the second song speech frame into frequency domain features, and obtaining a second spectrum vector of each of the second song speech frames;

[0029] Performing Mel filter bank filtering on the second frequency spectrum vector of each of the second song speech frames to obtain a second step Mel frequency spectrum vector of each of the second song speech frames;

[0030] Performing discrete cosine transform on the second Mel-frequency spectrum vector of each of the second song speech frames to obtain a second Mel-frequency cepstral coefficient vector of each of the second song speech frames;

[0031] Combining all the second Mel-cepstral coefficient vectors according to the order of the corresponding second song speech frames in the target music genre song to obtain an initial spectrum vector of the target music genre song;

[0032] The initial frequency spectrum vector of the target music genre song is reduced in dimension to obtain the frequency spectrum vector of the target music genre song of a preset vector dimension.

[0033] Optionally, the extracting music genre features from the target genre song spectrum feature vector using a pre-built music genre classification model to obtain the target genre feature vector comprises:

[0034] Inputting the target genre song spectrum feature vector into the music genre classification model, and obtaining the output value of each output node in the network layer before the classifier in the music genre classification model;

[0035] All the output values ​​are combined according to the order of the corresponding output nodes in the network layer to obtain the target genre feature vector.

[0036] Optionally, the extracting music genre features from the target genre song spectrum feature vector using a pre-built music genre classification model to obtain the target genre feature vector comprises:

[0037] Inputting the target genre song spectrum feature vector into the music genre classification model, and obtaining the output value of each output node in the network layer of the preset layer order in the music genre classification model;

[0038] All the output values ​​are combined according to the order of the corresponding output nodes in the network layer to obtain the target genre feature vector.

[0039] In order to solve the above problem, the present invention further provides a music genre conversion device, the device comprising:

[0040] The feature extraction module is used to extract the spectrum features and fundamental frequency features of the song to be converted, and obtain the spectrum vector and fundamental frequency vector of the song to be converted; extract the spectrum features of the target music genre song, and obtain the spectrum feature vector of the target music genre song; use the pre-built music genre classification model to extract the music genre features of the spectrum feature vector of the target music genre song, and obtain the target genre feature vector;

[0041] A feature combination module, used to reconstruct spectrum features using the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector to obtain a converted song spectrum vector;

[0042] The speech mapping module is used to map the converted song spectrum vector into speech to obtain the converted song.

[0043] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0044] a memory storing at least one computer program; and

[0045] The processor executes the computer program stored in the memory to implement the above-mentioned music genre conversion method.

[0046] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned music genre conversion method.

[0047] The embodiment of the present invention extracts the spectrum features and fundamental frequency features of the song to be converted to obtain the spectrum vector of the song to be converted and the fundamental frequency vector of the song to be converted; extracts the spectrum features of the target music genre song to obtain the spectrum feature vector of the target music genre song; uses the pre-constructed music genre classification model to extract the music genre features of the spectrum feature vector of the target genre song to obtain the target genre feature vector; reconstructs the spectrum features using the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector to obtain the spectrum vector of the converted song; maps the spectrum vector of the converted song to speech to obtain the converted song. Compared with only being able to convert to a fixed music genre, the embodiment of the present invention can set different target music genre songs according to the patient's treatment needs, and then dynamically convert the song to be converted into the corresponding music genre, thereby improving the flexibility of music genre conversion based on the patient's treatment needs. Therefore, the music genre conversion method, device, electronic device and readable storage medium proposed in the embodiment of the present invention improve the flexibility of music genre conversion based on the patient's treatment needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A schematic diagram of a flow chart of a music genre conversion method provided by an embodiment of the present invention;

[0049] Figure 2 A schematic diagram of a module of a music genre conversion device provided by an embodiment of the present invention;

[0050] Figure 3 A schematic diagram of the internal structure of an electronic device for implementing a method for converting music genres provided by an embodiment of the present invention;

[0051] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0052] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0053] The embodiment of the present invention provides a method for converting music genres. The execution subject of the music genre conversion method includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided in the embodiment of the present application. In other words, the music genre conversion method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.

[0054] Reference Figure 1 FIG. 1 is a flow chart of a method for converting music genres according to an embodiment of the present invention. In the embodiment of the present invention, the method for converting music genres comprises the following steps:

[0055] S1, extracting the spectrum features and fundamental frequency features of the song to be converted, and obtaining the spectrum vector and fundamental frequency vector of the song to be converted;

[0056] The song to be converted in the embodiment of the present invention is the audio of a song that the patient who does not meet the diagnosis and treatment needs wants to listen to. In order to make the song meet the diagnosis and treatment needs of the patient, the music genre of the song to be converted needs to be converted.

[0057] In detail, the method of extracting the spectrum feature and fundamental frequency feature of the song to be converted in the embodiment of the present invention to obtain the spectrum vector and fundamental frequency vector of the song to be converted includes:

[0058] Performing frame division and windowing on the song to be converted to obtain a plurality of first song speech frames;

[0059] Performing short-time Fourier transform on each of the first song speech frames to convert the time domain features of the first song speech frames into frequency domain features, thereby obtaining a first spectrum vector of each of the first song speech frames;

[0060] Performing Mel filter bank filtering on the first spectrum vector of each of the first song speech frames to obtain the first step Mel spectrum vector of each of the first song speech frames;

[0061] Performing discrete cosine transform on the first Mel-frequency spectrum vector of each of the first song speech frames to obtain a first Mel-frequency cepstral coefficient vector of each of the first song speech frames;

[0062] Extracting the fundamental frequency of the first spectrum vector of each of the first song speech frames to obtain the fundamental frequency feature value of each of the first song speech frames;

[0063] Combining all the first Mel-cepstral coefficient vectors according to the order of the corresponding first song speech frames in the song to be converted, to obtain an initial spectrum vector of the song to be converted;

[0064] Performing dimension reduction on the initial frequency spectrum vector of the song to be converted to obtain the frequency spectrum vector of the song to be converted of a preset vector dimension;

[0065] All the fundamental frequency feature values ​​are combined according to the order of the corresponding first song speech frames in the song to be converted to obtain the fundamental frequency vector of the song to be converted.

[0066] Furthermore, in the embodiment of the present invention, the fundamental frequency extraction is performed on the first spectrum vector of each of the first song speech frames to obtain the fundamental frequency feature value of each of the first song speech frames, including:

[0067] Based on the first spectrum vector, the fundamental pitch period or fundamental pitch frequency of each of the first song speech frames is calculated to obtain the fundamental pitch feature value of each of the first song speech frames.

[0068] In detail, in one embodiment of the present invention, based on the first spectrum vector, the fundamental pitch period or fundamental pitch frequency of each of the first song speech frames is calculated to obtain the fundamental pitch feature value of each of the first song speech frames, including:

[0069] Taking the logarithm of the elements in the frequency spectrum vector of each of the first song speech frames and then performing Fourier transform to obtain the fundamental frequency feature vector of each of the first song speech frames;

[0070] Obtaining the position corresponding to the first peak element in the fundamental frequency feature vector of the first song speech frame to obtain the target position;

[0071] The target position or the reciprocal of the target position is determined as the pitch feature value.

[0072] In one embodiment of the present invention, the process of extracting the spectrum feature and fundamental frequency feature of the song to be converted to obtain the spectrum vector and fundamental frequency vector of the song to be converted includes:

[0073] Extracting the spectrum envelope of the song to be converted to obtain an initial spectrum feature vector of the song to be converted;

[0074] Performing dimension reduction on the initial frequency spectrum vector of the song to be converted to obtain the frequency spectrum vector of the song to be converted of a preset vector dimension;

[0075] The fundamental frequency of the song to be converted is extracted to obtain the fundamental frequency vector of the song to be converted.

[0076] In the embodiment of the present invention, the spectrum envelope and fundamental frequency of the song to be converted can be extracted by the WORLD vocoder. The spectrum envelope is a curve used to describe the amplitude change of the voice signal of the song to be converted at different frequencies. It can be represented by a one-dimensional vector (the initial spectrum feature vector of the song to be converted), and each element corresponds to the amplitude value on a frequency. For example, if the spectrum envelope of the song to be converted is extracted as a 256-point spectrum envelope, it can be represented by a vector with a length of 256, and each element represents the amplitude value on a frequency component; the fundamental frequency is used to describe the frequency of the lowest frequency sine wave in the voice signal of the song to be converted, which determines the pitch and voiced sound of the voice signal. The fundamental frequency can be represented by a one-dimensional vector (i.e., the fundamental frequency vector of the song to be converted), and each element corresponds to the fundamental frequency value on a time frame. For example, if the song to be converted is a 100-frame voice signal, each frame is 10 milliseconds, then it can be represented by a vector with a length of 100 to represent the fundamental frequency, and each element represents the fundamental frequency value on a time frame.

[0077] S2, extracting spectrum features of songs of the target music genre to obtain spectrum feature vectors of songs of the target music genre;

[0078] The target music genre song in the embodiment of the present invention is the audio of the song corresponding to the music genre that the song to be converted is to be converted, that is, the sample songs of the corresponding song genre are screened and set according to the patient's treatment needs. For example, if the music genre of the song to be converted is to be converted to music genre A for treating the patient, then the target music genre song is the song of music genre A.

[0079] In detail, the method of extracting the spectrum feature of the target music genre song in the embodiment of the present invention to obtain the spectrum feature vector of the target music genre song includes:

[0080] Performing frame division and windowing on the target music genre song to obtain a plurality of second song speech frames;

[0081] Performing short-time Fourier transform on each of the second song speech frames to convert the time domain features of the second song speech frame into frequency domain features, and obtaining a second spectrum vector of each of the second song speech frames;

[0082] Performing Mel filter bank filtering on the second frequency spectrum vector of each of the second song speech frames to obtain a second step Mel frequency spectrum vector of each of the second song speech frames;

[0083] Performing discrete cosine transform on the second Mel-frequency spectrum vector of each of the second song speech frames to obtain a second Mel-frequency cepstral coefficient vector of each of the second song speech frames;

[0084] Combining all the second Mel-cepstral coefficient vectors according to the order of the corresponding second song speech frames in the target music genre song to obtain an initial spectrum vector of the target music genre song;

[0085] The initial frequency spectrum vector of the target music genre song is reduced in dimension to obtain the frequency spectrum vector of the target music genre song of a preset vector dimension.

[0086] The method of extracting spectrum features of songs of a target music genre to obtain spectrum feature vectors of songs of the target music genre in one embodiment of the present invention includes:

[0087] Extracting the spectrum envelope of the target music genre song to obtain the initial spectrum feature vector of the target music genre song;

[0088] The initial frequency spectrum vector of the target music genre song is reduced in dimension to obtain the frequency spectrum vector of the target music genre song of a preset vector dimension.

[0089] S3, using a pre-built music genre classification model to extract music genre features from the target genre song spectrum feature vector to obtain a target genre feature vector;

[0090] In the embodiment of the present invention, the music genre features of the target genre song spectrum feature vector are extracted, and the music genre features of the target genre song spectrum feature vector are extracted using a pre-constructed music genre classification model to obtain the target genre feature vector. Since the music genre classification model classifies the music genre features corresponding to the target genre song spectrum feature vector, it has a strong ability to extract music genre features. Therefore, the music genre features of the target genre song spectrum feature vector are extracted using a pre-constructed music genre classification model to obtain the target genre feature vector.

[0091] Optionally, the music genre classification model described in the embodiment of the present invention may be a trained deep learning model that can classify songs into music genres, and may be a convolutional neural network, etc., which is not limited in the embodiment of the present invention.

[0092] In detail, the method of extracting music genre features from the target genre song spectrum feature vector using the pre-built music genre classification model in the embodiment of the present invention to obtain the target genre feature vector includes:

[0093] Inputting the target genre song spectrum feature vector into the music genre classification model, and obtaining the output value of each output node in the network layer before the classifier in the music genre classification model;

[0094] All the output values ​​are combined according to the order of the corresponding output nodes in the network layer to obtain the target genre feature vector.

[0095] In another embodiment of the present invention, a pre-built music genre classification model is used to extract music genre features from the target genre song spectrum feature vector to obtain the target genre feature vector, including:

[0096] Inputting the target genre song spectrum feature vector into the music genre classification model, and obtaining the output value of each output node in the network layer of the preset layer order in the music genre classification model;

[0097] All the output values ​​are combined according to the order of the corresponding output nodes in the network layer to obtain the target genre feature vector.

[0098] S4, reconstructing spectrum features using the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector to obtain a spectrum vector of the converted song;

[0099] In order to obtain the spectral features of the song to be converted after the music genre conversion in the embodiment of the present invention, the spectral features are reconstructed using the spectral vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector to obtain the spectral vector of the converted song.

[0100] In detail, the method of reconstructing the spectrum features by using the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector to obtain the spectrum vector of the converted song in the embodiment of the present invention includes:

[0101] Performing vector concatenation of the song spectrum vector to be converted, the song fundamental frequency vector to be converted, and the target genre feature vector to obtain a converted song feature vector;

[0102] The converted song feature vector is dimensionally upgraded to obtain a converted song spectrum vector having the same dimension as the initial spectrum vector of the song to be converted.

[0103] Furthermore, in order to determine the characteristics of the converted song in the embodiment of the present invention, the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the characteristic vector of the target genre are vector-concatenated to obtain a characteristic vector of the converted song.

[0104] In detail, in the embodiment of the present invention, the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector are concatenated to obtain the converted song feature vector, including:

[0105] The frequency spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector are connected in the first place according to a preset vector order to obtain the feature vector of the converted song.

[0106] Furthermore, in an embodiment of the present invention, in order to convert the converted song feature vector into audio, it is necessary to first convert the converted song feature vector into a spectrum. Therefore, the converted song feature vector is dimensionally upgraded to obtain a converted song spectrum vector of the same dimension as the initial spectrum vector of the song to be converted.

[0107] In the embodiment of the present invention, an encoder can be used for dimensionality reduction, and a decoder can be used for dimensionality increase. The encoder is a trained first deep learning network, and the decoder is a trained second deep learning network. The specific training process is as follows:

[0108] Obtain a training song set, the first deep learning network, and the second deep learning network;

[0109] Randomly select a training song from the training song collection to obtain a target training song;

[0110] Extracting the frequency spectrum features of the target training song to obtain an initial frequency spectrum vector of the target training song;

[0111] Extracting the fundamental frequency feature of the target training song to obtain the fundamental frequency vector of the target training song;

[0112] Using the first deep learning network to reduce the dimension of the initial frequency spectrum vector of the target training song to obtain a frequency spectrum vector of the target training song;

[0113] Using a pre-built music genre classification model to extract music genre features from the target training song spectrum vector, to obtain a target training song genre feature vector;

[0114] Reconstructing the spectrum features by using the spectrum vector of the target training song, the fundamental frequency vector of the target training song and the genre feature vector of the target training song to obtain a generated spectrum vector of the target training song;

[0115] Utilizing the discriminator to analyze the target training song spectrum vector and the authenticity probability of the target training song generated spectrum vector, obtaining the authenticity probability of the music genre conversion song and the authenticity probability of the real genre song;

[0116] Calculate a target loss value using a pre-constructed loss function to measure the difference between the authenticity probability of the music genre conversion song and the authenticity probability of the real genre song;

[0117] Determining whether a preset training condition is met based on the target loss value;

[0118] When the preset training condition is reached, the first deep learning network at this time is output to obtain the encoder, and the second deep learning network at this time is output to obtain the decoder;

[0119] When the preset training conditions are not met, the model parameters of the first deep learning network, the second deep learning network and the discriminator are adjusted, and the step of randomly selecting a training song from the training song set to obtain a target training song is returned.

[0120] In detail, the discriminator in the embodiment of the present invention is used to evaluate how realistic the target training song generated spectrum vector generated by the decoder is, and how credible the target training song spectrum vector is. The discriminator is a binary classifier, and its output is a probability value between 0 and 1, indicating the possibility that the input data belongs to the real distribution. If the output is close to 1, it means that the input data is likely to be real; if the output is close to 0, it means that the input data is likely to be false. We take the target training song spectrum vector and the target training song generated spectrum vector as input, and obtain the output of the discriminator, the probability of authenticity of the real genre song and the probability of authenticity of the music genre conversion song, that is, the corresponding output when the target training song spectrum vector is used as input is the probability of authenticity of the real genre song, and the corresponding output when the target training song spectrum vector is used as input is the probability of authenticity of the music genre conversion song.

[0121] Specifically, the training songs in the embodiment of the present invention are of the same type as the songs to be converted, the first deep learning network and the second deep learning network can be convolutional neural networks, the training condition is the convergence of the target loss value, and in the embodiment of the present invention, the gradient descent method and other methods can be used to adjust the model parameters.

[0122] S5. Map the converted song spectrum vector to speech to obtain a converted song.

[0123] In order to convert the converted song spectrum vector into a song in the embodiment of the present invention, the converted song spectrum vector is mapped into speech to obtain a converted song.

[0124] In detail, in the embodiment of the present invention, mapping the converted song spectrum vector into speech to obtain the converted song includes:

[0125] The frequency spectrum vector of the converted song is converted into a waveform signal in the time domain to obtain the converted song.

[0126] Optionally, in an embodiment of the present invention, the acoustic conversion song spectrum vector can be converted into a waveform signal in the time domain by means of vocoder reconstruction to obtain a converted song.

[0127] Furthermore, the embodiment of the present invention can play the converted song to the patient to adjust the patient's emotions and achieve the purpose of treatment.

[0128] like Figure 2 The figure shows a functional module diagram of the music genre conversion device of the present invention.

[0129] The music genre conversion device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the music genre conversion device can include a feature extraction module 101, a feature combination module 102, and a voice mapping module 103. The modules described in the present invention can also be referred to as units, which refer to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, and are stored in a memory of the electronic device.

[0130] In this embodiment, the functions of each module / unit are as follows:

[0131] The feature extraction module 101 is used to extract the spectrum feature and fundamental frequency feature of the song to be converted, and obtain the spectrum vector of the song to be converted and the fundamental frequency vector of the song to be converted; extract the spectrum feature of the target music genre song to obtain the spectrum feature vector of the target music genre song; use the pre-constructed music genre classification model to extract the music genre feature of the spectrum feature vector of the target music genre song to obtain the target genre feature vector;

[0132] The feature combination module 102 is used to reconstruct the spectrum feature by using the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector to obtain the spectrum vector of the converted song;

[0133] The speech mapping module 103 is used to map the converted song spectrum vector into speech to obtain a converted song.

[0134] In detail, each module described in the music genre conversion device 100 in the embodiment of the present invention is used in the same manner as described above. Figure 1 The music genre conversion method described in the invention has the same technical means and can produce the same technical effects, so I will not go into details here.

[0135] like Figure 3 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing the method for converting music genres according to the present invention.

[0136] The electronic device may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a music genre conversion program.

[0137] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 may not only be used to store application software and various types of data installed in the electronic device, such as the code of a music genre conversion program, but may also be used to temporarily store data that has been output or is to be output.

[0138] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules (such as music genre conversion programs, etc.) stored in the memory 11, and calls data stored in the memory 11 to execute various functions of the electronic device and process data.

[0139] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is configured to realize connection and communication between the memory 11 and at least one processor 10, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0140] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0141] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure classification circuits, power converters or inverters, power status indicators, etc. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0142] Optionally, the communication interface 13 may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices.

[0143] Optionally, the communication interface 13 may also include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0144] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0145] The music genre conversion program stored in the memory 11 in the electronic device is a combination of multiple computer programs. When running in the processor 10, it can achieve:

[0146] Extract the spectrum features and fundamental frequency features of the song to be converted, and obtain the spectrum vector vector and fundamental frequency vector of the song to be converted;

[0147] Extracting the spectrum features of songs of the target music genre to obtain the spectrum feature vectors of the songs of the target music genre;

[0148] Using a pre-built music genre classification model, extracting music genre features from the target genre song frequency spectrum feature vector to obtain a target genre feature vector;

[0149] Reconstructing the spectrum features using the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector to obtain a converted song spectrum vector;

[0150] The converted song spectrum vector is mapped to speech to obtain the converted song. Specifically, the specific implementation method of the processor 10 for the above computer program can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0151] Furthermore, if the module / unit integrated in the electronic device 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. The computer-readable medium can be non-volatile or volatile. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM).

[0152] An embodiment of the present invention may further provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program may implement:

[0153] Extract the spectrum features and fundamental frequency features of the song to be converted, and obtain the spectrum vector vector and fundamental frequency vector of the song to be converted;

[0154] Extracting the spectrum features of songs of the target music genre to obtain the spectrum feature vectors of the songs of the target music genre;

[0155] Using a pre-built music genre classification model, extracting music genre features from the target genre song frequency spectrum feature vector to obtain a target genre feature vector;

[0156] Reconstructing the spectrum features using the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector to obtain a converted song spectrum vector;

[0157] The converted song spectrum vector is mapped to speech to obtain a converted song.

[0158] Furthermore, the computer-usable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0159] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0160] The modules described as separate components may or may not be physically separated, and the components shown as modules 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0161] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0162] In addition, each functional module in each embodiment of the present invention 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 hardware plus software functional modules.

[0163] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0164] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0165] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0166] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.

[0167] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A music genre conversion method, characterized in that: The method comprises: Extract the frequency spectrum feature and fundamental frequency feature of the song to be converted, and obtain the frequency spectrum vector and fundamental frequency vector of the song to be converted; Extracting the spectrum features of songs of the target music genre to obtain the spectrum feature vectors of the songs of the target music genre; Using a pre-built music genre classification model, extracting music genre features from the target genre song frequency spectrum feature vector to obtain a target genre feature vector; Reconstructing the spectrum features using the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector to obtain a spectrum vector of the converted song; The converted song spectrum vector is mapped to speech to obtain a converted song.

2. The music genre conversion method according to claim 1, characterized in that: The step of extracting the spectrum feature and fundamental frequency feature of the song to be converted to obtain the spectrum vector and fundamental frequency vector of the song to be converted includes: Performing frame division and windowing on the song to be converted to obtain a plurality of first song speech frames; Performing short-time Fourier transform on each of the first song speech frames to convert the time domain features of the first song speech frames into frequency domain features, thereby obtaining a first spectrum vector of each of the first song speech frames; Performing Mel filter bank filtering on the first spectrum vector of each of the first song speech frames to obtain the first step Mel spectrum vector of each of the first song speech frames; Performing discrete cosine transform on the first Mel-frequency spectrum vector of each of the first song speech frames to obtain a first Mel-frequency cepstral coefficient vector of each of the first song speech frames; Extracting the fundamental frequency of the first spectrum vector of each of the first song speech frames to obtain the fundamental frequency feature value of each of the first song speech frames; Combining all the first Mel-cepstral coefficient vectors according to the order of the corresponding first song speech frames in the song to be converted, to obtain an initial spectrum vector of the song to be converted; Performing dimension reduction on the initial frequency spectrum vector of the song to be converted to obtain the frequency spectrum vector of the song to be converted of a preset vector dimension; All the fundamental frequency feature values ​​are combined according to the order of the corresponding first song speech frames in the song to be converted to obtain the fundamental frequency vector of the song to be converted.

3. The music genre conversion method as claimed in claim 2, characterized in that: The step of extracting the spectrum feature and fundamental frequency feature of the song to be converted to obtain the spectrum vector and fundamental frequency vector of the song to be converted includes: Extracting the spectrum envelope of the song to be converted to obtain an initial spectrum feature vector of the song to be converted; Performing dimension reduction on the initial frequency spectrum vector of the song to be converted to obtain the frequency spectrum vector of the song to be converted of a preset vector dimension; The fundamental frequency of the song to be converted is extracted to obtain the fundamental frequency vector of the song to be converted.

4. The music genre conversion method as claimed in claim 2, characterized in that: The reconstructing the spectrum feature by using the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector to obtain the spectrum vector of the converted song includes: Performing vector concatenation of the song spectrum vector to be converted, the song fundamental frequency vector to be converted, and the target genre feature vector to obtain a converted song feature vector; The converted song feature vector is dimensionally upgraded to obtain a converted song spectrum vector having the same dimension as the initial spectrum vector of the song to be converted.

5. The music genre conversion method according to claim 1, characterized in that: The step of extracting the spectrum feature of the target music genre song to obtain the spectrum feature vector of the target music genre song includes: Performing frame division and windowing on the target music genre song to obtain a plurality of second song speech frames; Performing short-time Fourier transform on each of the second song speech frames to convert the time domain features of the second song speech frame into frequency domain features, and obtaining a second spectrum vector of each of the second song speech frames; Performing Mel filter bank filtering on the second frequency spectrum vector of each of the second song speech frames to obtain a second step Mel frequency spectrum vector of each of the second song speech frames; Performing discrete cosine transform on the second Mel-frequency spectrum vector of each of the second song speech frames to obtain a second Mel-frequency cepstral coefficient vector of each of the second song speech frames; Combining all the second Mel-cepstral coefficient vectors according to the order of the corresponding second song speech frames in the target music genre song to obtain an initial spectrum vector of the target music genre song; The initial frequency spectrum vector of the target music genre song is reduced in dimension to obtain the frequency spectrum vector of the target music genre song of a preset vector dimension.

6. The music genre conversion method according to claim 1, characterized in that: The method of extracting music genre features from the target genre song spectrum feature vector using the pre-built music genre classification model to obtain the target genre feature vector comprises: Inputting the target genre song spectrum feature vector into the music genre classification model, and obtaining the output value of each output node in the network layer before the classifier in the music genre classification model; All the output values ​​are combined according to the order of the corresponding output nodes in the network layer to obtain the target genre feature vector.

7. The music genre conversion method according to any one of claims 1 to 6, characterized in that: The method of extracting music genre features from the target genre song spectrum feature vector using the pre-built music genre classification model to obtain the target genre feature vector comprises: Inputting the target genre song spectrum feature vector into the music genre classification model, and obtaining the output value of each output node in the network layer of the preset layer order in the music genre classification model; All the output values ​​are combined according to the order of the corresponding output nodes in the network layer to obtain the target genre feature vector.

8. A music genre conversion device, characterized in that: include: A feature extraction module is used to extract the spectrum features and fundamental frequency features of the song to be converted, and obtain the spectrum vector and fundamental frequency vector of the song to be converted; Extracting the spectrum features of the target music genre song to obtain the spectrum feature vector of the target music genre song; extracting the music genre features of the spectrum feature vector of the target music genre song by using a pre-built music genre classification model to obtain the target genre feature vector; A feature combination module, used to reconstruct spectrum features using the spectrum vector of the song to be converted, the fundamental frequency vector of the song to be converted and the target genre feature vector to obtain a converted song spectrum vector; The speech mapping module is used to map the converted song spectrum vector into speech to obtain the converted song.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the music genre conversion method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the music genre conversion method according to any one of claims 1 to 7 is implemented.