Method for realizing telephone audio mixing by using FPGA (Field Programmable Gate Array)

By using FPGA chips to mix telephone audio in fire telephone systems, the problem of audio signal noise accumulation in multi-stage optical transmission equipment is solved, high-quality call effect is achieved, and system cost is reduced.

CN119832918AActive Publication Date: 2025-04-15SHENZHEN FANHAI SANJIANG ELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510053932.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-04-15
Estimated Expiration
2045-01-14

AI Technical Summary

Technical Problem

In the cascade of multi-stage optical transmission equipment, the mixing function is required to be implemented in each level of equipment, resulting in the accumulation of audio signal noise and reducing call quality.

Method used

The FPGA chip is used to receive data frames sent by an external encoder, extract the serial PCM code stream, perform serial and parallel transformation, store it in the register group, and perform multiple addition operations through the timing control logic module to realize the mixing of telephone audio.

Benefits of technology

Telephone audio mixing is realized through FPGA, reducing hardware design complexity and system cost, avoiding the problem of audio signal noise accumulation, improving call quality, and opening up more digital audio function applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832918A_ABST
    Figure CN119832918A_ABST
Patent Text Reader

Abstract

The invention relates to a method for realizing telephone audio mixing by using an FPGA (Field Programmable Gate Array), which comprises the following steps of: S10, receiving a data frame sent by an external encoder by the FPGA chip, and extracting a serial PCM (Pulse Code Modulation) code stream in the data frame; s20, the FPGA chip converts the serial PCM code stream obtained in the step S10 into a parallel linear PCM code; s30, under the control of the sequential control logic module, performing additive operation on the multi-path linear PCM data by adopting a multi-path adder to obtain a new parallel linear PCM code so as to achieve a sound mixing effect; s40, the FPGA chip converts the new parallel linear PCM code obtained in the step S30 into a new serial PCM code stream; the new serial PCM code stream is sent to an external encoder; the method is ingenious in design, and on one hand, the complexity of hardware design can be greatly reduced and the system cost can be reduced by realizing the sound mixing function of the telephone audio signal in the FPGA; and on the other hand, more digital audio function applications can be developed by researching digital audio signals and mastering related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of audio processing, and more particularly to a method for implementing telephone audio mixing by using FPGA. Background Art

[0002] In the actual application of fire telephone system, analog audio is generally used. If there are multiple telephone extensions talking to the telephone switchboard, the audio signals of each telephone extension and the telephone switchboard can be directly superimposed on the analog telephone bus, thereby achieving the effect of analog mixing.

[0003] When using optical transmission technology to extend the distance of the fire telephone system, it is necessary to convert the analog audio signal into a digital audio signal, and then combine it into a data frame according to the data protocol through a timing logic circuit to achieve the interconnection and interoperability of optical transmission. If the optical transmission equipment uses a point-to-point connection, analog mixing can still be completed on the analog telephone bus side, thereby realizing the function of multiple fire telephone extensions talking at the same time. However, when these optical transmission devices are cascaded, it may be necessary to implement the mixing function at each level of optical transmission equipment. The mixing implementation method on the market is generally analog mixing, that is, combining the CODEC chip on the optical transmission equipment, and building an addition circuit through an operational amplifier to achieve mixing, but when multi-level mixing is required, the accumulated audio signal noise will reduce the call quality. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method for implementing telephone audio mixing using FPGA in view of the above-mentioned defects of the prior art.

[0005] The technical solution adopted by the present invention to solve the technical problem is: a method for implementing telephone audio mixing using FPGA, using an FPGA chip, wherein the method comprises the following steps:

[0006] S10: The FPGA chip receives the data frame sent by the external encoder and extracts the serial PCM code stream therein;

[0007] S20: The FPGA chip converts the serial PCM code stream obtained in S10 into a parallel linear PCM code;

[0008] S30: The converted parallel linear PCM code is stored in a register group, and multiple registers in the register group correspond to audio data of different extensions respectively. Under the control of the timing control logic module, the multi-channel linear PCM data is added by a multi-channel adder to obtain a new parallel linear PCM code to achieve a mixing effect;

[0009] S40: The FPGA chip converts the new parallel linear PCM code obtained in S30 into a new serial PCM code stream; and sends the new serial PCM code stream to the external encoder;

[0010] The method for implementing telephone audio mixing using FPGA of the present invention, wherein in step S20, the FPGA chip performs serial-to-parallel conversion on the serial PCM code stream, converting the serial PCM code stream into 8-bit parallel PCM code;

[0011] The method for implementing telephone audio mixing using FPGA of the present invention, wherein multiple channels of audio data are transmitted in a serial data frame using a time division multiplexing method, and a timing control logic function module in the FPGA extracts a segment of audio data at different times and generates 8-bit parallel PCM codes corresponding to different extensions;

[0012] The method for implementing telephone audio mixing using FPGA of the present invention, wherein the FPGA chip is internally provided with a first lookup table from PCM code to linear code and a second lookup table from linear code to PCM code; the address contents of the first lookup table and the second lookup table are both target code types, and when the parallel PCM code is connected to the address signal of the first lookup table, the first lookup table outputs the target code type;

[0013] The method for implementing telephone audio mixing using FPGA of the present invention, wherein, in step S40, the new parallel linear PCM code is converted from linear code to PCM code and from parallel signal to serial signal to obtain a new serial linear PCM code;

[0014] The method for implementing telephone audio mixing using FPGA of the present invention comprises the following steps: the FPGA receives the RD port data of the optical module, first detects and locates the frame synchronization header, then finds new serial linear PCM code data according to the data frame structure, and the serial linear PCM code data is sent to the external encoder after being processed;

[0015] The method for implementing telephone audio mixing using FPGA of the present invention, wherein the method steps of serial-to-parallel conversion of the serial PCM code stream by the FPGA chip are as follows:

[0016] S21: Clock and data synchronization, using the PLL or DLL of the FPGA chip to multiply and phase-adjust the input serial clock to generate a sampling clock synchronized with the serial data;

[0017] S22: Serial data reception, receiving the serial PCM code stream through the serial receiver of the FPGA, and matching the serial data rate with the internal clock rate of the FPGA;

[0018] S23: Serial-to-parallel conversion. In each clock cycle, the next bit in the data stream is shifted into the register, while all other bits in the register are shifted one position to the right. The frame synchronization signal is used in the FPGA to reset the shift register to ensure that the parallel output data is aligned. When the shift register is filled with data, the data of the entire register can be output in parallel within one clock cycle to obtain parallel linear PCM code, thereby completing the serial-to-parallel conversion.

[0019] The method for implementing telephone audio mixing using FPGA of the present invention further comprises the following steps:

[0020] S24: Data verification and processing: After the parallel linear PCM code is output, data verification (such as parity check) and format conversion are performed on it to ensure the correctness of the data.

[0021] The beneficial effects of the present invention are as follows: the method for implementing telephone audio mixing using FPGA is cleverly designed. Implementing the mixing function of telephone audio signals in FPGA can greatly reduce the complexity of hardware design and reduce system costs on the one hand; on the other hand, more functional applications of digital audio can be developed through the study of digital audio signals and the mastery of related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be further described below in conjunction with the accompanying drawings and embodiments. The drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work:

[0023] Figure 1 It is a principle block diagram of a method for implementing telephone audio mixing using FPGA according to a preferred embodiment of the present invention;

[0024] Figure 2 is a first lookup table for converting PCM code to linear code in a preferred embodiment of the present invention;

[0025] Figure 3 is a second lookup table for converting linear code to PCM code in a preferred embodiment of the present invention;

[0026] Figure 4 It is a flow chart of a method for implementing telephone audio mixing using FPGA according to a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0027] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present invention and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

[0028] Reference to "embodiments" herein 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 invention. The appearance of the phrase in various places 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 skilled in the art that the embodiments described herein may be combined with other embodiments.

[0029] "Multiple" means two or more. "And / or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0030] Moreover, the terms "up, down, front, back, left, right, upper end, lower end, longitudinal" and the like indicating directions are all based on the posture and position of the device or equipment described in this solution during normal use.

[0031] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the following will be described clearly and completely in combination with the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are partial embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention.

[0032] A method for implementing telephone audio mixing using FPGA in a preferred embodiment of the present invention is as follows: Figure 1-4 As shown, an FPGA chip is used. In this embodiment, the FPGA uses a domestic FPGA with an embedded M3 core to realize fire telephone protocol processing, digital audio signal processing, digital signal transceiver processing, etc.

[0033] The method comprises the following steps:

[0034] S10: The FPGA chip receives the data frame sent by the external encoder and extracts the serial PCM code stream therein;

[0035] S20: The FPGA chip converts the serial PCM code stream obtained in S10 into a parallel linear PCM code;

[0036] Wherein, in step S20, the FPGA chip performs serial-to-parallel conversion on the serial PCM code stream, converting the serial PCM code stream into 8-bit parallel PCM code;

[0037] Multi-channel audio data is transmitted in a time-division multiplexing manner in a serial data frame. The timing control logic function module in the FPGA extracts a segment of audio data at different times and generates 8-bit parallel PCM codes corresponding to different extensions.

[0038] The conversion relationship between PCM and linear code complies with the ITU-T G.711 standard; PCM code is the standard digital audio data used by all CODEC chips on the market. It is the standard data for digitizing analog audio signals at an 8K sampling rate according to the classic Shannon sampling theorem in information theory, communication and signal processing. Through the lookup table method, audio data conversion can be performed efficiently and quickly.

[0039] By implementing serial to parallel PCM bitstream conversion through FPGA and converting audio data according to the G.711 standard, an efficient, low-latency, standard-compliant and flexible audio processing solution can be provided, which is very suitable for telephone audio mixing and other real-time audio processing applications.

[0040] The steps of the method for the FPGA chip to perform serial-to-parallel conversion on the serial PCM code stream are as follows:

[0041] S21: Clock and data synchronization, use the PLL or DLL of the FPGA chip to multiply and phase the input serial clock to generate a sampling clock synchronized with the serial data; it can reduce data sampling errors and improve the accuracy of data reception; at the same time, it ensures the stability of data during transmission; and improves data processing speed and efficiency.

[0042] S22: Serial data reception, receiving the serial PCM code stream through the FPGA's serial receiver, and matching the serial data rate with the FPGA's internal clock rate to facilitate subsequent processing.

[0043] S23: Serial-to-parallel conversion. In each clock cycle, the next bit in the data stream is shifted into the register, while all other bits in the register are shifted one position to the right. The frame synchronization signal is used in the FPGA to reset the shift register to ensure the alignment of the parallel output data. When the shift register is filled with data, the data of the entire register can be output in parallel within one clock cycle to obtain a parallel linear PCM code, thereby completing the serial-to-parallel conversion. The parallel processing capability of the FPGA can be used to increase the data processing speed. The frame synchronization signal is used to reset the shift register to ensure the alignment of parallel data and avoid data misalignment.

[0044] S24: Data verification and processing. After the parallel linear PCM code is output, data verification (such as parity check) and format conversion are performed on it. This can detect and correct errors that may occur during data transmission to ensure the correctness of the data.

[0045] Furthermore, the FPGA chip is provided with a first PCM code to linear code lookup table (LUT1), and a second linear code to PCM code lookup table (LUT2); the address contents of the first lookup table and the second lookup table are both target code types, and when the parallel PCM code is connected to the address signal of the first lookup table, the first lookup table outputs the target code type; wherein the content of the first lookup table is as follows: Figure 2 As shown; the content of the second lookup table is as follows Figure 3 As shown in the figure. Using a lookup table can reduce the logic resources required in the FPGA. The lookup table is an efficient hardware implementation method that does not require complex logic circuits. It can reduce the delay of data processing, which is particularly important for real-time audio processing. Using a lookup table to convert PCM code to linear code and vice versa can provide a fast, accurate, low-latency and resource-efficient audio data processing solution, which is very suitable for the use of FPGA in audio processing applications.

[0046] S30: The converted parallel linear PCM code is stored in a register group, and multiple registers in the register group correspond to audio data of different extensions. Under the control of the timing control logic module, the multi-channel linear PCM data is added by a multi-channel adder to obtain a new parallel linear PCM code to achieve the mixing effect. Linear coding has a high dynamic range and accuracy. The mixing achieved in this way can not only provide high-quality audio processing effects, but also make full use of the parallel processing capabilities and hardware resources of FPGA to achieve efficient and real-time audio mixing functions.

[0047] In this embodiment, an adder core is provided inside the FPGA, and the adder function can be easily used by calling the module. It should be noted that in order to ensure the call quality, the output result of the adder cannot be simply used directly, but the range, amplitude, etc. must be judged, and appropriate attenuation must be performed according to the number of mixed paths.

[0048] S40: The FPGA chip converts the new parallel linear PCM code obtained in S30 into a new serial PCM code stream; and sends the new serial PCM code stream to the external encoder.

[0049] In step S40, the new parallel linear PCM code is converted from linear code to PCM code and from parallel signal to serial signal to obtain a new serial linear PCM code.

[0050] FPGA receives the RD port data of the optical module, first detects and locates the frame synchronization header, then finds the new serial linear PCM code data according to the data frame structure, and sends the serial linear PCM code data to the external encoder after processing. Through the detection of the frame synchronization header, the correct alignment of the data during transmission can be ensured to avoid data misalignment; the accurate positioning of the serial linear PCM code data according to the data frame structure can improve the accuracy of data processing; the converted serial PCM code stream can be compatible with the standard interface of the external encoder or other equipment, which is convenient for system integration;

[0051] On the one hand, the FPGA chip sends the required calculation results to the local encoder circuit to realize the conversion of digital audio to analog audio, thereby realizing audio reception of local devices; on the other hand, the FPGA sends the corresponding calculation results to the upper-level host or optical transmission equipment or lower-level optical transmission equipment through data frames, and each device performs corresponding processing; it has strong adaptability, versatility and portability; through these steps, the FPGA can not only effectively process and convert audio data, but also ensure that the data is sent to the external encoder in the correct manner, thereby maintaining high standards of audio quality and system stability throughout the communication link.

[0052] This method of using FPGA to implement telephone audio mixing can achieve good sound quality while processing and transmitting audio signals with a deterministic and extremely low latency, improving the application scenarios of traditional fire telephone systems and meeting specific requirements such as dispersed terminal deployment, long distances, and telephone host networking.

[0053] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should fall within the scope of protection of the appended claims of the present invention.

Claims

1. A method for implementing telephone audio mixing using FPGA, using an FPGA chip, characterized in that: The method comprises the following steps: S10: The FPGA chip receives the data frame sent by the external encoder and extracts the serial PCM code stream therein; S20: The FPGA chip converts the serial PCM code stream obtained in S10 into a parallel linear PCM code; S30: The converted parallel linear PCM code is stored in a register group, and multiple registers in the register group correspond to audio data of different extensions respectively. Under the control of the timing control logic module, the multi-channel linear PCM data is added by a multi-channel adder to obtain a new parallel linear PCM code to achieve a mixing effect; S40: The FPGA chip converts the new parallel linear PCM code obtained in S30 into a new serial PCM code stream; and sends the new serial PCM code stream to the external encoder.

2. The method for implementing telephone audio mixing using FPGA according to claim 1, characterized in that: In step S20, the FPGA chip performs serial-to-parallel conversion on the serial PCM code stream, converting the serial PCM code stream into 8-bit parallel PCM code.

3. The method for implementing telephone audio mixing using FPGA according to claim 2, characterized in that: Multi-channel audio data is transmitted in a serial data frame using time division multiplexing. The timing control logic function module in the FPGA extracts a segment of audio data at different times and generates 8-bit parallel PCM codes corresponding to different extensions.

4. The method for implementing telephone audio mixing using FPGA according to claim 3, characterized in that: The FPGA chip is internally provided with a first lookup table from PCM code to linear code and a second lookup table from linear code to PCM code; the address contents of the first lookup table and the second lookup table are both target code types, and when the parallel PCM code is connected to the address signal of the first lookup table, the first lookup table outputs the target code type.

5. The method for implementing telephone audio mixing using FPGA according to any one of claims 1 to 4, characterized in that: In step S40, the new parallel linear PCM code is converted from a linear code to a PCM code and from a parallel signal to a serial signal to obtain a new serial linear PCM code.

6. The method for implementing telephone audio mixing using FPGA according to claim 5, characterized in that: The FPGA receives the RD port data of the optical module, first detects and locates the frame synchronization header, and then finds the new serial linear PCM code data according to the data frame structure. The serial linear PCM code data is processed and sent to the external encoder.

7. The method for implementing telephone audio mixing using FPGA according to claim 2, characterized in that: The steps for the FPGA chip to convert the serial PCM code stream into parallel are as follows: S21: Clock and data synchronization, using the PLL or DLL of the FPGA chip to multiply and phase-adjust the input serial clock to generate a sampling clock synchronized with the serial data; S22: Serial data reception, receiving the serial PCM code stream through the serial receiver of the FPGA, and matching the serial data rate with the internal clock rate of the FPGA; S23: Serial-to-parallel conversion. In each clock cycle, the next bit in the data stream is shifted into the register, while all other bits in the register are shifted one position to the right. The frame synchronization signal is used in the FPGA to reset the shift register to ensure that the parallel output data is aligned. When the shift register is filled with data, the data of the entire register can be output in parallel within one clock cycle to obtain a parallel linear PCM code, thereby completing the serial-to-parallel conversion.

8. The method for implementing telephone audio mixing using FPGA according to claim 7, characterized in that: The following steps are also included: S24: Data verification and processing: After the parallel linear PCM code is output, data verification and format conversion are performed on it to ensure the correctness of the data.

Citation Information

Patent Citations

  • FPGA-based two-way sound mixing method

    CN108810294A