Signal processing method and system, electronic device and storage medium

By calculating the target cumulative phase of the multiphase filter bank and performing synchronous sampling rate conversion, the problem of high sampling cost of audio signals is solved, low-power and low-cost signal processing is achieved, and the complexity of digital circuits is reduced.

CN118971884APending Publication Date: 2024-11-15SHANGHAI UNITED IMAGING MICROELECTRONICS TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411029530.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In the prior art, the asynchronous sampling rate conversion method of audio signals is high cost and the digital circuit is complex, resulting in high system complexity and power consumption.

Method used

By calculating the target accumulated phase of the polyphase filter bank based on the preset number of samples, the target accumulated phase of the polyphase filter bank is calculated and synchronous sampling rate conversion is used to reduce the dependence on high-precision frequency detection, and the polyphase filter bank and precompensation are used. The filter performs signal processing.

Benefits of technology

A low-power and low-cost signal processing method is realized, which reduces the complexity of digital circuits, reduces the cost of audio signal sampling, and improves the low-cost design efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118971884A_ABST
    Figure CN118971884A_ABST
Patent Text Reader

Abstract

The invention relates to a signal processing method and system, an electronic device and a storage medium, and the method comprises the steps: converting an obtained asynchronous sampling signal into frame data; based on the sampling rate of the asynchronous sampling signal, calculating a target accumulated phase of the multi-phase filter bank; and performing synchronous sampling rate conversion on each frame of data according to the target accumulated phase. According to the invention, the problem of high cost of audio signal sampling is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of signal processing technology, and in particular to a signal processing method, system, electronic device and storage medium. Background Art

[0002] Since audio signals need to be transmitted and shared between different devices and regions, it is necessary to solve the problem caused by different sampling rates of input audio signals and output audio signals. If the sampling rate is not converted, the played audio signal may be lost, resulting in playback distortion and reduced playback quality.

[0003] In signal processing, asynchronous sampling rate conversion methods can generally be divided into two types: one is to convert the asynchronous audio signal into an analog signal through a digital to analog converter (DAC), and then resample it through an analog to digital converter (ADC) to obtain a digital signal with the required local sampling rate. The other method is to convert the audio signal into a high sampling rate signal through a digital filter with a high interpolation coefficient, and then adjust the decimation factor or phase step in real time through frequency detection calculation to achieve asynchronous sampling rate conversion. However, the first method relies on the accuracy of the converter, increases the complexity of the system, and the cost of implementation is also very high; the excessively high interpolation coefficient in the second method requires the digital circuit to have high performance, and also requires high-precision frequency detection. Therefore, the above sampling rate conversion method will result in a high cost for audio signal sampling.

[0004] Currently, no effective solution has been proposed for the problem of high audio signal sampling cost in related technologies. Summary of the invention

[0005] The embodiments of the present application provide a signal processing method, system, electronic device and storage medium to at least solve the problem of high audio signal sampling cost in the related art.

[0006] In a first aspect, an embodiment of the present application provides a signal processing method, the method comprising:

[0007] Acquire frame data based on an asynchronous sampling signal with a preset sampling number;

[0008] Calculating a target cumulative phase of a polyphase filter bank based on a sampling rate of the asynchronously sampled signal;

[0009] According to the target accumulation phase, synchronous sampling rate conversion is performed on each frame of the frame data.

[0010] In some embodiments, the step of calculating a target cumulative phase of a polyphase filter bank based on a sampling rate of the asynchronously sampled signal comprises:

[0011] Obtaining a local clock frequency, and calculating a ratio between the local clock frequency and a target sampling rate;

[0012] Calculating the number of local clocks according to the preset number of samples, the local clock frequency and the sampling rate of the asynchronous sampling signal;

[0013] Calculating an average phase accumulation result in each frame according to the preset sampling quantity, the ratio, the number of local clocks and the number of phases of the polyphase filter bank;

[0014] The target accumulated phase is determined according to the average phase accumulated result and a preset initial phase.

[0015] In some embodiments, the step of performing synchronous sampling rate conversion on each frame of the frame data using the polyphase filter bank according to the target accumulated phase and generating a signal sampling result includes:

[0016] Calculating a convolution starting point of the frame data according to a first association relationship between the target accumulated phase and the phase number;

[0017] Calculating the actual selected phase of the polyphase filter bank according to a second association relationship between the target accumulated phase and the phase number;

[0018] Based on the convolution starting point and the actual selected phase, a filtering convolution result output after the frame data is input into the polyphase filter bank is calculated.

[0019] In some embodiments, after calculating the filtering convolution result output after inputting the frame data into the polyphase filter bank, the method further comprises:

[0020] Calculating interphase interpolation coefficients according to the convolution starting point, the actually selected phase, the number of phases and the target accumulated phase;

[0021] The signal sampling result is calculated according to the interpolation coefficients and the filter convolution result by using linear interpolation.

[0022] In some embodiments, the method further comprises:

[0023] Using a pre-compensation filter, performing filter convolution processing on each frame of the input frame data, and outputting the processed frame data; the pre-compensation filter is connected to the polyphase filter group;

[0024] According to the target accumulation phase, the processed frame data is subjected to synchronous sampling rate conversion using the polyphase filter bank, and a signal sampling result is generated.

[0025] In some embodiments, the method further comprises:

[0026] A pre-compensation filter is used to perform filtering and convolution processing on each frame of the input frame data, and the processed frame data is output; the pre-compensation filter is connected to the polyphase filter group.

[0027] In some embodiments, the pre-compensation filter is used to perform filtering and convolution processing on each frame of the input frame data, and the processed frame data is output, including:

[0028] Acquire a pre-compensation filter coefficient from a pre-compensation filter coefficient memory; wherein the pre-compensation filter coefficient memory is connected to the pre-compensation filter;

[0029] The pre-compensation filter is used to perform filtering and convolution processing on the frame data according to the pre-compensation filter coefficients to obtain the processed frame data.

[0030] In some embodiments, the target accumulated phase is stored in a frame frequency detection module; the polyphase filter bank is connected to the frame frequency detection module; and / or,

[0031] The polyphase filter coefficients are stored in a polyphase filter coefficient memory; the polyphase filter coefficients are used to determine the transfer function of the synchronous sampling rate conversion; the polyphase filter bank is connected to the polyphase filter coefficient memory.

[0032] In a second aspect, an embodiment of the present application provides a signal processing system, the system comprising: an input stage memory, a polyphase filter bank and an output stage memory; the polyphase filter bank is connected to the input stage memory and the output stage memory respectively;

[0033] The input stage memory is used to acquire and cache a preset number of asynchronous sampling signals;

[0034] The polyphase filter bank is used to read the target accumulated phase of the polyphase filter bank calculated based on the sampling rate of the asynchronous sampling signal;

[0035] The polyphase filter bank is further used to perform synchronous sampling rate conversion on each frame of frame data according to the target cumulative phase; the frame data is obtained based on the asynchronous sampling signal of the preset sampling number;

[0036] The output stage memory is used to receive and buffer the signal sampling results output by the polyphase filter bank.

[0037] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the signal processing method as described in the first aspect above when executing the computer program.

[0038] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the signal processing method described in the first aspect above is implemented.

[0039] Compared with the related art, the signal processing method, system and electronic device provided in the embodiments of the present application obtain frame data through an asynchronous sampling signal based on a preset sampling number; calculate the target cumulative phase of the multi-phase filter group based on the sampling rate of the asynchronous sampling signal; synchronize the sampling rate of each frame of the frame data according to the target cumulative phase; it realizes a clock detection frame interval with a low frequency relative to the phase, reduces the dependence of high-precision frequency detection on the local high-frequency clock, and is conducive to the low-power and low-cost design of the audio system; at the same time, the real-time asynchronous sampling rate conversion is converted into a frame-based synchronous sampling rate conversion, which also reduces the complexity of the digital circuit, thereby solving the problem of high cost of audio signal sampling and realizing a low-cost and low-power signal processing method.

[0040] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0042] Figure 1 It is a hardware structure block diagram of a terminal of a signal processing method in an embodiment of the present application;

[0043] Figure 2 is a flow chart of a signal processing method according to an embodiment of the present application;

[0044] Figure 3 is a schematic diagram of a sampling rate conversion process according to an embodiment of the present application;

[0045] Figure 4 is a timing diagram of sampling rate conversion according to an embodiment of the present application;

[0046] Figure 5 is a structural block diagram of a signal processing system according to an embodiment of the present application;

[0047] Figure 6is a structural schematic diagram of a signal processing system according to an embodiment of the present application;

[0048] Figure 7 is a flowchart of another signal processing method according to an embodiment of the present application. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means, and should not be understood as insufficient contents disclosed in the present application.

[0050] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0051] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.

[0052] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. Taking running on a terminal as an example, Figure 1 is a hardware structure block diagram of a terminal of a signal processing method in an embodiment of the present application. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0053] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a signal processing method in an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0054] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0055] This embodiment provides a signal processing method. Figure 2 is a flow chart of a signal processing method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0056] Step S210, acquiring frame data based on an asynchronous sampling signal with a preset sampling quantity.

[0057] Among them, the above-mentioned asynchronous sampling signal refers to a signal of a preset number of samples sampled by a local clock at a fixed sampling rate. The preset number of samples can be set by the staff in combination with actual conditions; for example, the preset number of samples can be set to 32. In this embodiment, such a set of sampling signals with a preset number of samples can be regarded as a frame of frame data; illustratively, when the preset number of samples is 32 and the asynchronous sampling rate is 16KHz, a frame of frame data contains 32 16KHz sampling rate samples. Through the above steps, the audio signal is sent to the local audio system in a frame manner, and it is regarded as an asynchronous sampling method of asynchronous clock division.

[0058] Step S220: Calculate the target cumulative phase of the polyphase filter bank based on the sampling rate of the asynchronous sampling signal.

[0059] Polyphase filtering is to decompose the system function H(z) of the digital filter into several groups with different phases according to the uniform phase division, forming multiple branches, and realize filtering on each branch. That is, the above-mentioned polyphase filter group contains multiple filters with different phases. For example, Matlab can be used to generate multiple groups of low-pass filters with different initial phases, and these filters together constitute the polyphase filter group. In this step, the phase of the polyphase filter can be determined based on the adjustment of the extraction factor according to the asynchronous sampling rate of each frame sample; or, the sample can be detected based on the frequency of the frame, the cumulative phase of the same asynchronous sampling sample can be counted, and the average phase of each sample in the frame is calculated, and then the target cumulative phase of the above-mentioned polyphase filter group is calculated.

[0060] Step S230: performing synchronous sampling rate conversion on each frame of the frame data according to the target accumulation phase.

[0061] In this step, the polyphase filter bank can select a corresponding filter based on the target cumulative phase, and the selected filter can perform synchronous sampling rate conversion according to the coefficients of the polyphase filter bank. The polyphase filter coefficients are used to determine the transfer function in the filter, and the polyphase filter coefficients can be determined according to the polyphase filter bank structure parameters such as the filter order, upsampling range, and downsampling range. Specifically, the synchronous sampling rate conversion can be achieved by interpolating the frame data input to the selected filter and then extracting it. Please refer to Figure 3 , the sampling rate conversion process is as follows: x(n) is the frame data containing a set of sampling sequences with a sampling rate of fx input to the filter; n is used to represent the sampling time point, for example, x(1) represents the sampling result at 1*1 / fx, and x(2) represents the sampling result at 2*1 / fx. I is the interpolation multiple, and after upsampling using the interpolation multiple I, the sequence signal v(k) is output, and the sequence is input to the low-pass filter h[k]. L is the length of the low-pass filter h[k]; h[k] refers to the filter sequence vector (array), k represents the index of the array element, that is, h[1] represents the first array element, and h[2] represents the second array element. Then the v(k) sequence is processed by digital low-pass filtering and the sequence w(l) is output. D is the decimation multiple, and after downsampling using the decimation multiple D, the sequence signal y(m) is output. Among them, the relationship between the sampling rates of each signal is: fv=fw=I·fx; fv is the sampling rate of v(k), and fw is the sampling rate of w(l). And, for a polyphase filter bank, (Dm) I is the remainder when Dm is divided by I, is the integer quotient of Dm divided by I, h[(Dm) I +nI] is the multi-phase structure of the filter h[k]. Based on the above multi-phase filter coefficients, the calculation process of the filter output signal y[m] is shown in the following formula 1:

[0062]

[0063] The sampling rate of the output signal y[m] is fy=fx×I / D.

[0064] In the above signal processing method, by converting the asynchronous sampling signal with a preset sampling number into frame data, and using a multi-phase filter group to perform synchronous sampling rate conversion on each frame data in an interpolation manner, a relatively low-frequency clock detection frame interval is achieved, which reduces the dependence of high-precision frequency detection on the local high-frequency clock, and is beneficial to the low-power and low-cost design of the audio system; at the same time, the real-time asynchronous sampling rate conversion is converted into a frame-based synchronous sampling rate conversion, which also reduces the complexity of the digital circuit, thereby solving the problem of high cost of audio signal sampling and realizing a low-cost and low-power signal processing method.

[0065] It should be noted that, in the process of determining the asynchronous sampling rate, due to the uncertainty of the asynchronous processing delay, there is a certain risk in adjusting the decimation factor or the phase of the polyphase filter group sample by sample, so a high-frequency clock is required to improve the accuracy of the frequency or phase measurement. Based on this, in some embodiments, the above calculation of the target cumulative phase of the polyphase filter group according to the sampling rate of the asynchronous sampling signal also includes the following steps:

[0066] Step S221, obtaining a local clock frequency, and calculating a ratio between the local clock frequency and a target sampling rate.

[0067] The above-mentioned local clock frequency refers to the clock frequency of the audio system; the local clock frequency can be configured in advance by the staff and read by the main control chip during the sampling rate conversion process. The above-mentioned target sampling rate refers to the sampling rate of the audio signal required to be achieved after the sampling rate conversion; it can be set to a corresponding setting value such as 24K according to the needs of the actual application scenario, or it can be adapted to the actual audio system. For example, the local system clock frequency f_sys = 12.288MHz, the local playback audio sampling rate is 512 of the local system clock, that is, the calculated ratio between the local clock frequency and the target sampling rate N = 512, the target sampling rate, that is, the local audio playback sampling rate f_sink = f_sys / N = 24KHz.

[0068] Step S222, calculating the number of local clocks according to the preset number of samples of the asynchronous sampling signal, the local clock frequency and the sampling rate of the asynchronous sampling signal.

[0069] The calculation formula of the local clock quantity clk_sys_cnt is shown in the following formula 2:

[0070]

[0071] In the above formula, K represents the preset number of samples, f_sys is used to represent the local clock frequency, and f_src is used to represent the sampling rate of the asynchronous sampling signal, that is, the sampling rate of the input data of the polyphase filter bank.

[0072] Step S223, calculating the average phase accumulation result in each frame according to the preset sampling quantity, the ratio, the local clock quantity and the phase number.

[0073] The above-mentioned polyphase filter bank includes multiple phase groups. According to the number of phases M of the polyphase filter bank, the polyphase interpolation sampling rate f_int=f_src×M can be calculated. The sample average phase accumulation result after sampling conversion is Based on the above description, the following formula can be derived according to the relationship between the local clock frequency f_sys and the target sampling rate f_sink, and the relationship between the local clock frequency f_sys and the sampling rate f_src of the asynchronous sampling signal:

[0074]

[0075] It can be seen that through the simplified formula 3 above, the average phase accumulation result can be calculated directly according to the product of the preset sampling number, ratio and phase number read, and then the product is divided by the number of local clocks between adjacent frames counted, without adding redundant calculations in the intermediate steps, thereby improving the calculation efficiency.

[0076] The following is a brief description of the calculation process of the average phase accumulation result from step S221 to step S223. Figure 4 , taking the phase number M=3 of the multi-phase filter as an example, the input data sampling rate is f_src=16KHz, the local system clock frequency f_sys=12.288MHz, the local playback audio sampling rate is 512 divided by the local system clock, that is, N=512, and the local audio playback sampling rate f_sink=f_sys / N=24KHz.

[0077] Set K to 32, that is, one frame contains 32 16KHz sampling rate samples. Ideally, the local single frame count

[0078] Since the number of phases of the polyphase filter M is set to 3, the sampling rate after interpolation is f_int = f_src × M = 48KHz, so the original sampling rate phase accumulation phase_src = 3 (which can be understood as the sample interval 3), the average phase accumulation of the samples after the sampling conversion As above Figure 4The sampling rate conversion diagram is shown in FIG. 3. Further, each value can be substituted into the above formula 3 to calculate the average phase accumulation result phase_ave.

[0079] Step S224, determining the target accumulated phase according to the average phase accumulated result and the preset initial phase.

[0080] The above initial phase can be set according to the actual situation. Specifically, the target cumulative phase phase = phase + phase_ave for each frame data conversion at the target sampling rate; this formula indicates that the average phase accumulation result phase_ave is accumulated once for each frame data conversion for real-time update; in particular, at the first accumulation, the value of phase is the initial phase value, that is, the target cumulative phase phase = initial phase phase + phase_ave.

[0081] Through the above steps S221 to S224, the phase of the multi-phase filter group is determined by calculating the average cumulative phase of samples in each frame, thereby avoiding the problem of inaccurate phase determination caused by asynchronous processing delay, effectively improving the accuracy of phase detection, and further improving the sampling accuracy of the audio signal.

[0082] In some embodiments, the method of performing synchronous sampling rate conversion on each frame of the frame data using the polyphase filter bank according to the target accumulated phase and generating a signal sampling result comprises the following steps:

[0083] Step S231, calculating the convolution starting point of the frame data according to the first correlation between the target accumulated phase and the phase number; calculating the actual selected phase of the polyphase filter group according to the second correlation between the target accumulated phase and the phase number.

[0084] The convolution starting point is the starting position of the convolution in the digital sequence corresponding to the frame data. Therefore, the first association relationship is used to represent the integer quotient of the target accumulated phase divided by the number of phases, that is, based on the first association relationship, the convolution starting point can be calculated. Similarly, after calculating the target cumulative phase, since the part exceeding the target cumulative phase is the first phase of the multi-phase filter, the second association relationship is used to represent the remainder of the target cumulative phase divided by the number of phases, that is, based on the second association relationship, the actual selected phase phase_int=mod(phase,M) can be calculated.

[0085] by Figure 4Taking the sampling rate conversion schematic diagram shown as an example, in the figure, each timing signal is, from top to bottom, frame data with a sampling rate of 16KHz (the frame data is obtained from an asynchronous sampling signal containing a preset number of samples), a multi-phase interpolation sampling signal with a sampling rate of 48KHz obtained by multi-phase interpolation through a multi-phase filter group, and a converted sampling signal with a sampling rate of 24KHz obtained after synchronous sampling rate conversion based on interphase interpolation coefficients. Then, multi-phase interpolation point 1 and multi-phase interpolation point 2 are obtained by convolution calculation based on the original sampling rate starting point 0 in the frame, and multi-phase interpolation point 4 and multi-phase interpolation point 2 are obtained by convolution calculation based on the original sampling rate starting point 1. Exemplarily, for sampling point 2 in the converted sampling signal with a sampling rate of 24KHz, its target accumulated phase at the multi-phase interpolation point is 2*phase_ave=4, so its original sampling rate convolution starting point The phase selection of the polyphase filter, that is, the actual selected phase is phase_int=mod(phase,M)mod(4,3)=1.

[0086] Step S232, based on the convolution starting point and the actual selected phase, calculate the filtering convolution result output after the frame data is input into the polyphase filter group.

[0087] Specifically, the filter convolution f1 with the actual selected phase phase_int as the starting point S of the convolution is calculated, and the filter convolution f2 with the phase of the next polyphase filter of the actual selected phase is calculated. The filter convolution result includes the filter convolution f1 and the filter convolution f2. Next, the filter convolution result can be calculated by linear interpolation to obtain the output conversion sample result.

[0088] In some embodiments, after the above calculation of the filter convolution result output after inputting the frame data into the polyphase filter bank, the following steps are also included:

[0089] Step S234, calculating the interphase interpolation coefficient according to the convolution starting point, the actually selected phase, the phase number and the target accumulated phase.

[0090] It should be noted that in the actual asynchronous sampling rate conversion process, due to the lack of clock homology, considering asynchronous statistical errors, and different sampling rate conversions, the phase of the converted sample may be a non-integer; based on this, in this embodiment, linear interpolation can be performed based on the calculated interphase interpolation coefficient. According to the above description of the relationship between the starting convolution point and the target cumulative phase, the actual selected phase and the target cumulative phase, it can be deduced that the calculation process of the interphase interpolation coefficient is: calculate the product of the starting convolution point and the phase number, and then calculate the target cumulative phase minus the product and the difference between the actual selected phase, and the difference is the interphase difference coefficient. That is, the calculation process of the interphase interpolation coefficient is as shown in the following formula 4:

[0091] phase_frac=phase-S×M-phase_int Formula 4

[0092] In the above formula, phase_frac is used to represent the interpolation coefficient, phase is used to represent the target cumulative phase, S is used to represent the convolution starting point, M is used to represent the number of phases, and phase_int is used to represent the actual selected phase. For example, see Figure 4 The phase point of the timing signal after synchronous sampling rate conversion is 4.1, and the sample point falls between the multi-phase sampling point 4 and the multi-phase sampling point 5. Therefore, by substituting the above formula 4, the phase difference coefficient phase_frac=phase-S×M-phase_int=4.1-1*3-1=0.1 can be calculated.

[0093] Step S235, using linear interpolation, calculates the signal sampling result according to the interpolation coefficients and the filter convolution result.

[0094] The process of calculating the conversion sample result using the linear difference, that is, the above signal sampling result, is shown in the following formula 5:

[0095] r = f1×(1-phase_frac)+f2×phase_frac Formula 5

[0096] In the above formula, r is used to represent the signal sampling result output after sampling rate conversion, f1 is used to represent the output result of the filter convolution with the actual selected phase, f2 is used to represent the output result of the subsequent multi-phase filter convolution, and phase_frac is used to represent the interphase interpolation coefficient.

[0097] Through the above embodiment, linear interpolation is performed by calculating the phase interpolation coefficients, which effectively avoids the problem that the phase point after conversion may be a non-integer, resulting in signal sampling errors, and the calculation process is simple, thereby improving the accuracy and efficiency of the algorithm, thereby improving the accuracy and efficiency of signal sampling.

[0098] In some embodiments, the signal processing method further comprises the following steps:

[0099] A pre-compensation filter is used to perform filtering and convolution processing on each frame of input data, and the processed frame data is output; the pre-compensation filter is connected to the polyphase filter group. The pre-compensation filter can be various low-order filters. For synchronous sampling rate conversion, a low-order pre-compensation filter is used to compensate for the passband attenuation of the subsequent polyphase extraction filter, increase the transition band attenuation, and suppress the stopband signal. Furthermore, a plurality of low-order passband pre-compensation filters are combined with a polyphase extraction filter group with fixed coefficients for sampling rate conversion, which can realize a multi-speed sampling rate conversion method and reduce the storage medium overhead.

[0100] In addition, in an optional embodiment, the above-mentioned use of the pre-compensation filter to filter and convolve each frame of the input frame data and output the processed frame data also includes the following steps: obtaining the pre-compensation filter coefficient of the pre-compensation filter coefficient memory; wherein the pre-compensation filter coefficient memory is connected to the pre-compensation filter; using the pre-compensation filter, filtering and convoluting the frame data according to the pre-compensation filter coefficient to obtain the processed frame data. It can be understood that the pre-compensation filter coefficient can be assigned an initial value by the staff during the filter design, and the value of the pre-compensation filter coefficient can be determined according to the design scenarios such as the pre-compensation filter level, up-sampling range and down-sampling range (i.e., high-frequency signal filtering requirements); and the value of the pre-compensation filter coefficient may change with the actual situation during the application process, so that the pre-compensation filter can be adapted to different application scenarios. Then, during the pre-compensation processing, the pre-compensation filter can read its cached frame data from the input stage memory, and read its stored pre-compensation filter coefficient from the pre-compensation filter coefficient memory, and complete the filtering convolution, and output the above-mentioned processed frame data.

[0101] Next, according to the target accumulated phase, the polyphase filter group is used to perform synchronous sampling rate conversion on the processed frame data, and a signal sampling result is generated. The synchronous sampling rate conversion process of the polyphase filter group on the processed frame data is similar to the synchronous sampling rate conversion process of the polyphase filter group on the frame data in any of the above method embodiments, and will not be repeated here.

[0102] It should be noted that, in the subsequent sampling rate conversion process, the processed data transmitted by the pre-compensation filter can be received by the polyphase filter group, and the processed frame data output by the pre-compensation filter after filtering. Alternatively, in another embodiment, the processed frame data output by the pre-compensation filter after filtering can also be cached in an internal inter-stage memory, and the polyphase filter group reads the processed frame data from the internal inter-stage memory, thereby avoiding the problem of sampling errors caused by the polyphase filter group being unable to handle a large amount of data. Among them, the internal inter-stage memory can adopt a storage device such as First Input First Output (FIFO).

[0103] Through the above embodiment, before the frame data is sampled at a higher rate using the polyphase filter group, pre-compensation processing of the frame data is added, thereby compensating for the energy loss of the post-stage filter, which is beneficial to reducing the ripple, thereby further improving the accuracy of signal sampling.

[0104] In some embodiments, the target cumulative phase is stored in a frame frequency detection module; the polyphase filter group is connected to the frame frequency detection module. The frame frequency detection module is used to detect the phase accumulation of frames (equal number of asynchronous audio signals) and calculate the average phase increment within the frame. And / or, the polyphase filter coefficients are stored in a polyphase filter coefficient memory; the polyphase filter coefficients are used to determine the transfer function of the synchronous sampling rate conversion; the polyphase filter group is connected to the polyphase filter coefficient memory. Through the above embodiments, different data are cached in different devices respectively, which is conducive to improving the calculation efficiency, thereby improving the signal sampling efficiency.

[0105] This embodiment also provides a signal processing system, Figure 5 is a structural block diagram of a signal processing system according to an embodiment of the present application, such as Figure 5 As shown, the system includes: an input stage memory 52, a polyphase filter group 54 and an output stage memory 56; the polyphase filter group 54 is connected to the input stage memory 52 and the output stage memory 56 respectively; wherein the input stage memory 52 and / or the output stage memory 56 can adopt storage devices such as FIFO.

[0106] The input stage memory 52 is used to acquire and cache a preset number of asynchronous sampling signals;

[0107] The polyphase filter bank 54 is used to read the target cumulative phase of the polyphase filter bank calculated based on the sampling rate of the asynchronous sampling signal;

[0108] The polyphase filter bank 54 is also used to perform synchronous sampling rate conversion on each frame of frame data according to the target cumulative phase, and generate a signal sampling result; the frame data is obtained by converting the asynchronous sampling signal based on the preset sampling number;

[0109] The output stage memory 56 is used to receive and buffer the signal sampling result.

[0110] In some embodiments, the signal processing system further includes a pre-compensation filter, which is respectively connected to the input stage memory 52 and the polyphase filter bank 54. The pre-compensation filter is used to read each frame of data from the input stage memory 52, perform filter convolution preprocessing on each frame of data, and output the processed frame data after the filter convolution preprocessing.

[0111] In the subsequent sampling rate conversion process, the processed data transmitted by the pre-compensation filter and the processed frame data output by the pre-compensation filter after filtering can be received by the polyphase filter group 54. Alternatively, in another embodiment, the processed frame data output by the pre-compensation filter after filtering can also be cached in an internal inter-stage memory, and the polyphase filter group 54 reads the processed frame data from the internal inter-stage memory, thereby avoiding problems such as sampling errors caused by the polyphase filter group 54 being unable to process a large amount of data.

[0112] In some embodiments, the signal processing system further comprises a pre-compensation filter coefficient memory connected to the pre-compensation filter. The pre-compensation filter coefficient memory is used to store low-order pre-compensation filter coefficients. The pre-compensation filter memory includes but is not limited to various storage devices such as read-only memory (ROM), random access memory (RAM), etc. In particular, in the present embodiment, the pre-compensation filter memory adopts ROM memory to improve the stability of data storage.

[0113] In some embodiments, the signal processing system further comprises a frame frequency detection module. The frame frequency detection module is used to store the target accumulated phase. The frame frequency detection module is connected to the polyphase filter bank 54.

[0114] In some embodiments, the signal processing system further comprises a polyphase filter coefficient memory. The polyphase filter coefficient memory is used to store sampling rate converted polyphase filter bank coefficients. The polyphase filter bank 54 is connected to the polyphase filter coefficient memory.

[0115] The embodiments of the present application are described in detail below in conjunction with actual application scenarios. Figure 6 is a schematic diagram of the structure of a signal processing system according to an embodiment of the present application, such as Figure 6As shown, the system includes an input stage memory, a pre-compensation filter coefficient memory, a pre-compensation filter, an internal inter-stage memory, a polyphase filter coefficient memory, a frame frequency detection module, a polyphase filter group and an output stage memory. Among them, the input stage memory is used to cache asynchronous sampling rate audio signal samples. The frame frequency detection module is used to detect the phase accumulation of frames (equal number of asynchronous audio signals) and calculate the average phase increment within the frame. The pre-compensation filter coefficient ROM stores low-order pre-compensation filter coefficients. The pre-compensation filter is used to control the operation data from the input stage memory and the pre-compensation filter coefficient memory, and complete the filter convolution, compensate for the energy loss of the post-stage filter, and reduce the ripple. The data after the pre-compensation filter is filtered is stored in the internal inter-stage memory. The polyphase filter coefficient memory is used to store the coefficients of the polyphase filter group for sampling rate conversion. The polyphase filter group selects the filter group according to the accumulated phase to complete the extraction or interpolation of the sampling rate conversion.

[0116] Figure 7 is a flowchart of another signal processing method according to an embodiment of the present application. Figure 7 As shown, the process includes the following steps:

[0117] Step S701, start the sampling process; the system clock collects a preset sampling number, which is a fixed number K of asynchronous signals, as a frame of data, and counts the number of local clocks clk_sys_cnt between adjacent frames; assuming that the ratio of the target sampling rate to the local clock frequency is N, the number of phases of the multi-phase filter group used for sampling rate conversion is M, and the average phase accumulation result of the samples in the update frame is calculated as phase_ave=M×N×K / clk_sys_cnt.

[0118] Step S702, calculate the target cumulative phase phase = phase + phase_ave of the target sampling rate conversion after each sampling rate conversion; determine the convolution starting point calculated for the frame data according to the integer quotient of the target cumulative phase phase divided by the phase number M, determine the actual selected phase of the multi-phase filter group according to the remainder of the target cumulative phase phase divided by the phase number M, and calculate the interphase interpolation coefficient.

[0119] Step S703, calculating the two-phase filter convolution results f1 and f2.

[0120] Step S704, calculate the linear interpolation of the two-phase data, and output the signal sampling result r=f1×(1-phase_frac)+f2×phase_frac.

[0121] Step S705, determining whether all sampled data have been converted, that is, whether to stop the sampling rate conversion; if so, the sampling process ends.

[0122] Step S706: If the result of the judgment in step S705 is no, it is judged whether the sampling rate conversion of the data in the current frame is completed. If yes, it returns to step S701 to update the average phase accumulation result phase_ave; if no, it returns to step S702 to continue calculating the target accumulated phase phase in the frame.

[0123] Through the above-mentioned embodiments, the traditional streaming asynchronous processing method is converted into a frame-based synchronous processing method, which reduces the system's dependence on the local high-frequency clock, is conducive to the development of low-cost, low-power audio systems, and reduces the dependence of high-precision frequency detection on the local high-frequency clock, which is conducive to the low-power, low-cost design of the system. At the same time, the real-time asynchronous sampling rate conversion is converted into a frame-based synchronous sampling rate conversion, which also reduces the complexity of the digital circuit. For the synchronous sampling rate conversion, a low-order pre-compensation filter is used to compensate for the passband attenuation of the post-stage multi-phase extraction filter, and the transition band attenuation is increased to suppress the stopband signal. Furthermore, the use of a variety of low-order passband pre-compensation filters and a fixed-coefficient multi-phase extraction filter group can realize multi-speed sampling rate conversion and reduce storage medium overhead.

[0124] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0125] This embodiment further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0126] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0127] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0128] S1, acquiring frame data based on an asynchronous sampling signal with a preset sampling quantity.

[0129] S2, calculating a target cumulative phase of the polyphase filter bank based on the sampling rate of the asynchronous sampling signal.

[0130] S3, performing synchronous sampling rate conversion on each frame of the frame data according to the target accumulated phase.

[0131] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0132] In addition, in combination with the signal processing method in the above embodiments, the present application embodiment may provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the signal processing methods in the above embodiments is implemented.

[0133] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0134] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0135] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A signal processing method, characterized in that: The method comprises: Acquire frame data based on an asynchronous sampling signal with a preset sampling number; Calculating a target cumulative phase of a polyphase filter bank based on a sampling rate of the asynchronously sampled signal; According to the target accumulation phase, synchronous sampling rate conversion is performed on each frame of the frame data.

2. The signal processing method according to claim 1, characterized in that: The step of calculating the target cumulative phase of the polyphase filter bank based on the sampling rate of the asynchronous sampling signal comprises: Obtaining a local clock frequency, and calculating a ratio between the local clock frequency and a target sampling rate; Calculating the number of local clocks according to the preset number of samples, the local clock frequency and the sampling rate of the asynchronous sampling signal; Calculating an average phase accumulation result in each frame according to the preset sampling quantity, the ratio, the number of local clocks and the number of phases of the polyphase filter bank; The target accumulated phase is determined according to the average phase accumulated result and a preset initial phase.

3. The signal processing method according to claim 2, characterized in that: The step of performing synchronous sampling rate conversion on each frame of the frame data using the polyphase filter bank according to the target accumulated phase and generating a signal sampling result includes: Calculating a convolution starting point of the frame data according to a first association relationship between the target accumulated phase and the phase number; Calculating the actual selected phase of the polyphase filter bank according to a second association relationship between the target accumulated phase and the phase number; Based on the convolution starting point and the actual selected phase, a filtering convolution result output after the frame data is input into the polyphase filter bank is calculated.

4. The signal processing method according to claim 3, characterized in that: After the calculation of the filtering convolution result output after the frame data is input to the polyphase filter bank, the method further comprises: Calculating interphase interpolation coefficients according to the convolution starting point, the actually selected phase, the number of phases and the target accumulated phase; The signal sampling result is calculated according to the interpolation coefficients and the filter convolution result by using linear interpolation.

5. The signal processing method according to claim 1, characterized in that: The method further comprises: A pre-compensation filter is used to perform filtering and convolution processing on each frame of the input frame data, and the processed frame data is output; the pre-compensation filter is connected to the polyphase filter group.

6. The signal processing method according to claim 5, characterized in that: The method of using a pre-compensation filter to perform filtering convolution processing on each frame of the input frame data and outputting the processed frame data comprises: Acquire a pre-compensation filter coefficient from a pre-compensation filter coefficient memory; wherein the pre-compensation filter coefficient memory is connected to the pre-compensation filter; The pre-compensation filter is used to perform filtering and convolution processing on the frame data according to the pre-compensation filter coefficients to obtain the processed frame data.

7. The signal processing method according to any one of claims 1 to 6, characterized in that: The target accumulated phase is stored in a frame frequency detection module; the polyphase filter bank is connected to the frame frequency detection module; and / or, The polyphase filter coefficients are stored in a polyphase filter coefficient memory; the polyphase filter coefficients are used to determine the transfer function of the synchronous sampling rate conversion; the polyphase filter bank is connected to the polyphase filter coefficient memory.

8. A signal processing system, characterized in that: The system comprises: an input stage memory, a polyphase filter bank and an output stage memory; the polyphase filter bank is connected to the input stage memory and the output stage memory respectively; The input stage memory is used to acquire and cache a preset number of asynchronous sampling signals; The polyphase filter bank is used to read the target accumulated phase of the polyphase filter bank calculated based on the sampling rate of the asynchronous sampling signal; The polyphase filter bank is further used to perform synchronous sampling rate conversion on each frame of frame data according to the target cumulative phase; the frame data is obtained based on the asynchronous sampling signal of the preset sampling number; The output stage memory is used to receive and buffer the signal sampling results output by the polyphase filter bank.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the signal processing method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the signal processing method according to any one of claims 1 to 7 when executed.