Full-duplex intercom device and method based on RS485 bus

By adopting a full-duplex intercom solution based on the RS485 bus in the intercom device for coal mines, combined with the analog audio bus and low-code audio encoding and decoding algorithm, the problem of insufficient transmission efficiency and anti-interference capability of the existing intercom device is solved, and a full-duplex intercom with efficient and strong anti-interference capability is achieved.

CN119676614AActive Publication Date: 2025-03-21CHINA COAL TECH & ENG GRP CHONGQING RES INST CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411680885.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-21
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

The existing intercom devices for coal mines have shortcomings in transmission efficiency and anti-interference capabilities, especially the CAN bus transmission can only achieve half-duplex intercom, which has weak anti-interference capabilities, and analog bus transmission is easily subject to electromagnetic interference.

Method used

The full-duplex intercom device based on the RS485 bus is adopted, combined with the RS485 bus and the analog audio bus, and the full-duplex intercom is realized through the audio encoding and decoding circuit and the low-code audio encoding and decoding algorithm, and the anti-interference capability and transmission distance are improved through the digital isolation circuit and the power amplifier circuit.

Benefits of technology

It realizes full duplex intercom, with a transmission distance of up to 5km, strong anti-interference ability, low power consumption, easy installation and low cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676614A_ABST
    Figure CN119676614A_ABST
Patent Text Reader

Abstract

The invention relates to a full-duplex intercom device and method based on an RS485 bus, and belongs to the technical field of broadcasting systems for coal mines. Comprising an audio amplification circuit, a microprocessor, a power amplification circuit, an audio encoding and decoding circuit, a man-machine interaction circuit, a digital isolation circuit, an RS485 transceiver circuit, an analog audio circuit, a power management circuit, an audio input device and an audio output device. The microprocessor is respectively connected with the audio encoding and decoding circuit, the man-machine interaction circuit and the digital isolation circuit; the audio amplification circuit is respectively connected with the audio input device, the audio encoding and decoding circuit and the analog audio circuit; the analog audio circuit is connected with the audio bus; the audio encoding and decoding circuit is connected with the power amplification circuit and the audio output device in sequence; the analog audio circuit is also connected with the power amplification circuit; the digital isolation circuit is connected with the RS485 transceiver circuit and the RS485 bus in sequence; the power management circuit is used for supplying power to each circuit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of broadcasting systems for coal mines, and relates to a full-duplex intercom device and method based on RS485 bus. Background Art

[0002] As a key component of the emergency broadcast system in the "six systems" of coal mine safety and risk avoidance, the mine broadcast intercom device is the main tool for daily production operations, disaster prevention and risk avoidance, and emergency rescue in major coal mines. At present, there are three main types of underground intercom devices: optical fiber transmission, CAN bus transmission, and analog audio transmission: optical fiber transmission intercom device: although it can realize full-duplex intercom, its power consumption is large, it cannot meet the long-distance power supply, and the cost is high. At the same time, it relies on optical cable transmission and cannot be used in places where fiber fusion is inconvenient, so it cannot be moved at any time; CAN bus transmission intercom device: it can only realize half-duplex intercom, and the intercom efficiency is low. The on-site installation and wiring must strictly follow the CAN bus rules and standards. When it involves multi-branch problems, the impedance matching requirements are high, and the terminal resistance needs to be adjusted, which makes on-site debugging inconvenient. Analog bus transmission intercom device: directly transmits analog signals on the bus, has weak anti-interference ability, and is easily affected by underground electromagnetic interference, resulting in poor sound quality during transmission. Summary of the invention

[0003] In view of this, the object of the present invention is to provide a full-duplex intercom device and method based on RS485 bus.

[0004] In order to achieve the above object, the present invention provides the following technical solutions:

[0005] On the one hand, the present invention provides a full-duplex intercom device based on RS485 bus, including an audio amplifier circuit, a microprocessor, a power amplifier circuit, an audio codec circuit, a human-computer interaction circuit, a digital isolation circuit, an RS485 transceiver circuit, an analog audio circuit, a power management circuit, an audio input device and an audio output device; the microprocessor is respectively connected to the audio codec circuit, the human-computer interaction circuit and the digital isolation circuit; the audio amplifier circuit is respectively connected to the audio input device, the audio codec circuit and the analog audio circuit; the analog audio circuit is connected to the audio bus; the audio codec circuit is connected to the power amplifier circuit and the audio output device in sequence; the analog audio circuit is also connected to the power amplifier circuit; the digital isolation circuit is connected to the RS485 transceiver circuit and the RS485 bus in sequence; the power management circuit is used to supply power to each circuit;

[0006] The audio amplifier circuit is used to amplify the amplitude of the original analog audio data collected by the audio input device, and then transmit it through the audio bus after passing through the analog audio circuit; or convert it into original PCM data through the audio codec circuit, and then perform low-bit-rate audio encoding into low-bit-rate audio data through the microprocessor, and then isolate the electrical connection between the input signal and the output signal through the digital isolation circuit, and finally transmit it through the RS485 bus after passing through the RS485 transceiver circuit;

[0007] The analog audio circuit is also used to receive analog audio data transmitted by the audio bus, transmit it to the power amplifier circuit for power amplification, and drive the audio output device to produce sound;

[0008] The RS485 transceiver circuit is also used to receive low-bit-rate audio data transmitted by the RS485 bus, isolate the electrical connection between the input signal and the output signal through the digital isolation circuit, and then decode the low-bit-rate audio into original PCM data through the microprocessor, convert it into an analog signal through the audio codec circuit, and then use the power amplifier circuit to amplify the power to drive the audio output device to sound;

[0009] The human-computer interaction circuit is used for inputting and displaying information.

[0010] Furthermore, the digital isolation circuit utilizes a photoelectric coupler to convert the input signal into an optical signal through the photoelectric coupler, and then converts it into a digital signal, thereby isolating the electrical connection between the RS485 input signal and the output signal.

[0011] Furthermore, the RS485 bus and audio bus use twisted pair cable as the transmission medium. The RS485 transceiver circuit is based on the serial communication 485 chip. When sending, the data signal in the microprocessor is converted into a differential signal through the 485 chip and transmitted to the receiving end through the RS485 bus. The receiving end receives the differential signal through the 485 chip, converts it into a digital signal, and inputs it into the microprocessor for analysis.

[0012] Furthermore, an audio noise reduction circuit is constructed using an operational amplifier, a capacitor and a resistor in the analog audio circuit to reduce electromagnetic interference introduced by the audio signal during transmission.

[0013] Furthermore, the power amplifier circuit includes a two-stage amplifier circuit, the first stage is an audio signal amplitude amplifier circuit, which is used to amplify the amplitude of the audio signal by 5 times and then output it to the second stage power amplifier circuit to increase the voltage amplification factor.

[0014] Furthermore, the human-computer interaction circuit includes an LED light, a screen and a button. The LED light serves as a status light to display the system status, the screen is used to display system operation data, the local device ID, and process information, and the button is used to input information.

[0015] On the other hand, the present invention provides a full-duplex intercom method based on RS485 bus, comprising the following steps:

[0016] S1: Initialize the audio codec, serial port, screen and corresponding IO port. After the initialization is completed, it enters the sleep state and waits to be woken up;

[0017] S2: First, wake up regularly to update screen information, including power level and device operation status, and then enter sleep mode after the update.

[0018] S3: When a key is triggered, it enters the working state. First, the target device number is sent through RS485 according to the key input, and the target intercom device is waited for to respond. If no response signal is received for a period of time, it continues to enter the dormant state; if a response is received, it enters the intercom process;

[0019] S4: After receiving the target device number transmitted by the RS485 bus, the other intercom devices determine whether it is the same as the target device number of this device. If not, they continue to return to the sleep state. If it is the same as the device number of this device, this device is the target intercom device, and the response is initiated by pressing the button to enter the full-duplex intercom process;

[0020] S5: After the intercom process is finished, the intercom device enters a dormant state, waits for the next wake-up, and returns to step S1.

[0021] Further, the full-duplex intercom process includes the following steps:

[0022] S41: The initiating intercom device inputs the target device number by pressing a key to determine the target intercom device, and sends the device number to the RS485 bus. At the same time, the initiating intercom device starts ringing, and the display screen shows calling;

[0023] S42: The other intercom devices receive the data on the RS485 bus. If their own device number is the same as the target device number, the target intercom device starts ringing, and the call information is displayed on the screen. After confirming the answer by pressing the button, the answer command is sent to the RS485 bus, and then the intercom starts. At this time, the screen displays "Intercom in progress", and the full-duplex intercom process is successfully established;

[0024] S43: After actively initiating the intercom device and receiving a response, the screen displays "intercom is in progress", collects microphone data, passes through an analog audio amplifier circuit, amplifies the analog audio amplitude by 20 times, and then transmits the audio data through an analog bus;

[0025] S44: After receiving the analog audio data, the target intercom device directly drives the speaker to sound through the power amplifier circuit, and collects the audio data of its own microphone at the same time, converts the analog audio signal into a digital signal through the A / D converter, obtains the encoded audio bit stream through the low bit rate audio encoding algorithm in the microprocessor, and then transmits it to the RS485 bus;

[0026] S45: After the intercom device actively initiates the acquisition of the audio bit stream, it is transmitted to the microprocessor, and the low bit rate audio decoding algorithm is used to synthesize the voice into digital audio data, which is converted into analog audio through D / A and sent by the power amplifier circuit to drive the speaker, thus completing a full-duplex intercom.

[0027] S46: When the intercom needs to be ended, either party initiates an end intercom command by pressing a button, which is transmitted through the RS485 bus. After the other party obtains the end command, it replies with an answer command, and the full-duplex intercom ends.

[0028] Further, the low bit rate audio coding algorithm in the microprocessor comprises the following steps:

[0029] A1: Preprocessing: The original speech signal is filtered through a high-pass filter with a cutoff frequency of 60Hz to remove the DC cost and 50Hz low-frequency interference, and three 25ms speech frames are combined into a super frame;

[0030] A2: The pre-processed speech signal is roughly estimated to obtain pitch. The high-frequency interference in the pitch period is removed by a low-pass filter. The accuracy of the pitch period is then calculated using the difference formula to obtain an accurate pitch period value. The pitch period is then uniformly quantized to distinguish between unvoiced and voiced sounds.

[0031] A3: Use the multi-band mixed excitation algorithm to further distinguish between unvoiced and voiced sounds, divide the signal into five sub-band signals through five bandpass filters, calculate their unvoiced intensity values ​​respectively, and quantify the results according to the correlation coefficient of each sub-band;

[0032] A4: Then, the extracted coefficients are transformed into corresponding LSP parameters using a multi-level vector quantization algorithm, and the LSP parameters are arranged in ascending order according to the minimum interval size to complete the quantization of the linear prediction coefficients;

[0033] A5: Calculate the residual signal from the quantized prediction coefficients, fill it with 512 sample values ​​using a Hamming window with a window length of 200, and perform fast Fourier transform and quantization.

[0034] A6: The final encoded bit number is 90 baud, a super frame length is 75ms, and the encoding rate is 1200b / s bit stream.

[0035] Further, the low bit rate audio decoding algorithm comprises the following steps:

[0036] B1: Analyze the speech frame bit stream information. If the two bits of the period bit are 1, it means the frame is discarded. If all bits are 0 or only one is 1, it is an unvoiced frame. Otherwise, it is a voiced frame.

[0037] B2: Add attenuation when gain decoding is restored, where the ambient noise is calculated as follows:

[0038]

[0039] Among them G n is the environmental noise, G up =0.0337435, G down =0.135418, G1 is the decoding gain in the pitch period;

[0040] B3: Perform synchronous interpolation processing on the decoded fundamental tone, reconstruct the integrity of the decoded parameters, and adopt different interpolation strategies according to the gain parameters, LSF parameters, pulse and noise coefficients of the mixed excitation, and the spectrum tilt coefficient of the adaptive enhancement filter;

[0041] B4: Superimpose multiple excitation signals, calculate the pulse excitation using the inverse discrete Fourier transform algorithm, cyclically shift the pulse excitation by 10 bits, and then multiply it by the square root of the fundamental frequency period;

[0042] B5: Use the adaptive enhancement filter to improve the distorted signal, and finally filter it through the linear synthesis filter to obtain the final synthesized speech signal.

[0043] The beneficial effects of the present invention are:

[0044] [1] Full-duplex intercom. The RS485 bus and the analog audio bus are organically combined to transmit the initiator's audio data via the analog bus and the target's audio data via the RS485 bus after a low-bitrate audio codec algorithm, thus achieving full-duplex intercom.

[0045] [2] Long transmission distance. RS485 uses a baud rate of 2400bps to transmit encoded audio data, with a maximum transmission distance of 5km. The amplified analog audio data can be transmitted through the analog bus, with a maximum transmission distance of 5km.

[0046] [3] Low power consumption. It works by periodically sleeping and waking up from tasks.

[0047] [4] Easy to install. The cable is directly used as the transmission medium. RS485 uses a baud rate of 2400bps to transmit the encoded audio data. The bus is less affected by impedance matching and can be connected to branches at will. The analog bus can also be wired at will.

[0048] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0050] Figure 1 This is the schematic diagram of the full-duplex intercom device based on RS485 bus;

[0051] Figure 2 This is a flow chart of low bit rate speech coding;

[0052] Figure 3 This is a flowchart for low bit rate speech decoding;

[0053] Figure 4 This is a full-duplex intercom algorithm diagram;

[0054] Figure 5 This is the program flow chart of the intercom device. DETAILED DESCRIPTION

[0055] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0056] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0057] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0058] The present invention provides a full-duplex intercom device and method based on RS485 bus, which uses the combination of RS485 bus and analog bus to complete long-distance real-time full-duplex intercom, wherein RS485 bus transmits compressed low-bitrate audio data, and analog bus directly transmits analog audio data. The device includes an audio amplifier circuit, a microprocessor, a power amplifier circuit, an audio codec circuit, a human-computer interaction circuit, a digital isolation circuit, an RS485 transceiver circuit and an analog audio circuit. In the full-duplex intercom method, each device has its own unique device number. When an intercom is to be initiated with a certain device, the target device is determined by key dialing in human-computer interaction, and then the target device number is sent to the corresponding device through the RS485 bus. After the target device confirms, the intercom can be initiated. The active intercom device first collects the original analog audio data of the microphone, directly amplifies the amplitude through the audio amplifier circuit, and then transmits it through the analog audio circuit using the analog audio bus. When the target device receives the analog audio data through the analog audio circuit, it is directly transmitted to the power amplifier circuit to drive the speaker to sound. When the target device replies to the intercom, the microphone audio data is collected, and the original PCM data is obtained after conversion by the audio amplifier circuit and the audio codec circuit. Then, the low-bit-rate audio coding algorithm is used in the microprocessor, and the audio is pre-processed, quantized, and encoded into 1.2kbit / s bit rate audio data, which is then transmitted through the RS485 bus with a baud rate of 2400bps. After the initiating intercom device receives the compressed audio data through the RS485 bus, the microprocessor is used to perform low-bit-rate audio decoding to obtain the original PCM data, which is converted into an analog signal through the audio codec circuit, and then the power amplifier circuit is used to directly drive the speaker to sound. When the intercom is ended, either party sends an end command through the RS485 bus to obtain a response, and then the intercom process can be terminated. After the above process, long-distance full-duplex intercom can be realized. The full-duplex intercom device and method based on the RS485 bus organically combines digital signals and analog signals to realize long-distance full-duplex intercom, and has the characteristics of easy installation, low cost and low power consumption.

[0059] Figure 1This is the schematic diagram of the intercom device. The power management circuit provides working power to other circuits and can stably output two intrinsically safe DC voltages of 5v and 12v. 5v is used to power the microprocessor, human-computer interaction circuit, audio codec circuit, digital isolation circuit and RS485 transceiver circuit, and 12v is used to power the power amplifier circuit; the digital isolation circuit uses a photocoupler to convert the input signal into an optical signal through the photocoupler, and then convert it into a digital signal, which can effectively isolate the electrical connection between the RS485 input signal and the output signal, and avoid electrical interference generated by the RS485 signal during transmission. The RS485 bus and audio bus use twisted pair cables as the transmission medium. The RS485 transceiver circuit uses the serial communication 485 chip as the core. When sending, the data signal in the microprocessor is converted into a differential signal through the 485 chip and transmitted to the receiving end through the RS485 bus. The receiving end receives the differential signal through the 485 chip and converts it into a digital signal, which is output to the microprocessor for analysis. In the analog audio circuit, operational amplifiers, capacitors, resistors and other components are used to build an audio noise reduction circuit to reduce the electromagnetic interference introduced by the audio signal during the transmission process. The audio signal after noise reduction is then passed through the power amplifier circuit to drive the 8Ω10W speaker to make sound. The power amplifier circuit contains two-stage amplifier circuits. The first stage is the audio signal amplitude amplifier circuit, which is used to amplify the amplitude of the audio signal by 5 times, and then output it to the second stage power amplifier circuit to increase the voltage amplification factor. The maximum output power is 15W, which is used to drive the 8Ω10W speaker. The audio amplifier circuit collects the microphone analog signal and then amplifies the audio amplitude by 20 times. Depending on the specific use, it can be directly transmitted to the analog bus through the analog audio circuit for transmission, or it can be converted into a digital audio signal through the audio codec circuit through A / D conversion and transmitted to the microprocessor. The human-computer interaction circuit includes LED lights, screens and buttons. The LED lights are used as status lights to display the system status. The screen is used to display system operation data, local device ID, and process information display. The buttons are used for information input. The microprocessor controls the normal operation of the entire system, runs the low-bitrate encoding and decoding algorithm, and coordinates the full-duplex intercom process.

[0060] I Low Bit Rate Speech Codec Algorithm Process

[0061] (1) Low bit rate speech coding:

[0062] The low bit rate speech coding process is as follows Figure 2 As shown, the steps are as follows;

[0063] S1: Preprocessing: The original speech signal is filtered out through a high-pass filter with a cutoff frequency of 60 Hz to remove the DC cost and 50 Hz low-frequency interference, and three 25 ms speech frames are combined into a super frame.

[0064] S2: The preprocessed speech signal is roughly estimated to obtain pitch. The high-frequency interference in the pitch period is removed by a low-pass filter. The accuracy of the pitch period is then further calculated using the difference formula to obtain an accurate pitch period value. The pitch period is then uniformly quantized to distinguish between unvoiced and voiced sounds.

[0065] S3: Use the multi-band mixed excitation algorithm to more accurately distinguish between unvoiced and voiced sounds. Divide the signal into 5 sub-band signals through 5 bandpass filters, calculate their unvoiced sound intensity values ​​respectively, and quantify the results according to the correlation coefficient of each sub-band.

[0066] S4: Then, the extracted coefficients are transformed into corresponding LSP parameters using a multi-level vector quantization algorithm, and are arranged in ascending order according to the minimum interval size of the LSP parameters, thereby completing the quantization of the linear prediction coefficients.

[0067] S5: The residual signal is calculated by the quantized prediction coefficient, filled with 512 sample values ​​using a Hamming window with a window length of 200, and fast Fourier transform and quantization are performed.

[0068] S6: The final number of bits encoded is 90 baud, and the length of a super frame is 75 ms. The encoding rate is further obtained as 90 / 0.075=1200 b / s bit stream.

[0069] (2) Low bit rate speech decoding

[0070] The low bit rate speech decoding process is as follows Figure 3 As shown, the steps are as follows:

[0071] S1: Analyze the speech frame bit stream information. If the two bits of the period bit are 1, it means the frame is discarded. If all bits are 0 or only one is 1, it is an unvoiced frame. Otherwise, it is a voiced frame.

[0072] S2: In order to reduce the interference of environmental noise, attenuation needs to be added during gain decoding and recovery. The method for calculating environmental noise is:

[0073]

[0074] Among them G n is the environmental noise, G up =0.0337435, G down =0.135418, G1 is the decoding gain in the fundamental frequency period.

[0075] S3: further perform synchronous interpolation processing on the decoded fundamental tone, reconstruct the integrity of the decoded parameters, and adopt different interpolation strategies according to the gain parameters, LSF parameters, pulse and noise coefficients of the mixed excitation, and the spectrum tilt coefficient of the adaptive enhancement filter.

[0076] S4: Multiple excitation signals are superimposed, and the pulse excitation is calculated using the inverse discrete Fourier transform algorithm. To improve the quality of speech decoding, the pulse excitation is cyclically shifted by 10 bits and then multiplied by the square root of the fundamental frequency period.

[0077] S5: After the above steps, the distorted signal is improved by using an adaptive enhancement filter, and finally filtered by a linear synthesis filter to obtain a final synthesized speech signal.

[0078] II Full-duplex Intercom Process

[0079] Full-duplex intercom devices connected to the same RS485 bus, each device has its own unique device number, and the intercom devices are connected through 4-core twisted pair shielded wires. When a full-duplex intercom is initiated, the process is as follows Figure 4 As shown:

[0080] S1: The initiating intercom device inputs the target device number by pressing a key to determine the target intercom device, and sends the device number to the RS485 bus. At the same time, the initiating intercom device starts ringing, and the display shows calling;

[0081] S2: The target intercom device receives data on the RS485 bus. If its own device number is the same as the target device number, the target device starts ringing and displays the incoming call information on the screen. After pressing the button to confirm the answer, the answer command is sent to the RS485 bus, and then the intercom can begin. At this time, the screen displays "Intercom in Progress", and the full-duplex intercom process is successfully established.

[0082] S3: After actively initiating the intercom device and receiving a response, the screen displays "intercom in progress" and starts collecting microphone data. The analog audio amplitude is amplified by 20 times through the analog audio amplifier circuit, and then the audio data is transmitted through the analog bus.

[0083] S4: After receiving the analog audio data, the target intercom device directly drives the speaker to sound through the power amplifier circuit, and collects the audio data of its own microphone at the same time, converts the analog audio signal into a digital signal through the A / D converter, obtains the encoded audio bit stream through the low bit rate audio encoding algorithm in the microprocessor, and then transmits it to the RS485 bus;

[0084] S5: After the intercom device obtains the audio bit stream, it is transmitted to the microprocessor and speech synthesis is performed using a low-bit-rate audio decoding algorithm. At this time, the digital audio data needs to be converted into analog audio through D / A and sent through the power amplifier circuit to drive the speaker to complete a full-duplex intercom.

[0085] S6: When the intercom needs to be ended, either party can initiate an end intercom command by pressing a button, which is transmitted through the RS485 bus. After the other party receives the end command, it replies with an answer command, and the full-duplex intercom ends.

[0086] III Intercom device program flow chart

[0087] The full-duplex intercom device mainly initializes peripherals, runs low-bitrate speech encoding and decoding algorithms, and controls the full-duplex intercom process. Its working steps are as follows, and the program flow chart is as follows: Figure 5 As shown:

[0088] S1: Initialize the audio codec, serial port, screen and corresponding IO port. After the initialization is completed, it enters the sleep state and waits to be woken up;

[0089] S2: First, wake up regularly to update screen information, including power level and device operation status, and then enter sleep mode after the update.

[0090] S3: If a key is triggered, it enters the working state. First, the target device number is sent through RS485 according to the key input, and the target intercom device responds. If no response signal is received within 20 seconds, it continues to enter the dormant state; if a response is received, it enters the intercom process;

[0091] S4: If the target device receives the target device number transmitted by the RS485 bus, it determines whether it is the same as the target number of the local device. If not, it returns to the sleep state. If it is the same as the device number of the local device, it confirms the response by pressing the button and enters the intercom process.

[0092] S5: After the intercom process is finished, the intercom device enters the sleep state, waits for the next wake-up, and returns to S1.

[0093] 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 purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A full-duplex intercom device based on RS485 bus, characterized in that: It includes an audio amplifier circuit, a microprocessor, a power amplifier circuit, an audio codec circuit, a human-computer interaction circuit, a digital isolation circuit, an RS485 transceiver circuit, an analog audio circuit, a power management circuit, an audio input device and an audio output device; the microprocessor is respectively connected to the audio codec circuit, the human-computer interaction circuit and the digital isolation circuit; the audio amplifier circuit is respectively connected to the audio input device, the audio codec circuit and the analog audio circuit; the analog audio circuit is connected to the audio bus; the audio codec circuit is connected to the power amplifier circuit and the audio output device in sequence; the analog audio circuit is also connected to the power amplifier circuit; the digital isolation circuit is connected to the RS485 transceiver circuit and the RS485 bus in sequence; the power management circuit is used to power each circuit; The audio amplifier circuit is used to amplify the amplitude of the original analog audio data collected by the audio input device, and then transmit it through the audio bus after passing through the analog audio circuit; or convert it into original PCM data through the audio codec circuit, and then perform low-bit-rate audio encoding into low-bit-rate audio data through the microprocessor, and then isolate the electrical connection between the input signal and the output signal through the digital isolation circuit, and finally transmit it through the RS485 bus after passing through the RS485 transceiver circuit; The analog audio circuit is also used to receive analog audio data transmitted by the audio bus, transmit it to the power amplifier circuit for power amplification, and drive the audio output device to produce sound; The RS485 transceiver circuit is also used to receive low-bit-rate audio data transmitted by the RS485 bus, isolate the electrical connection between the input signal and the output signal through the digital isolation circuit, and then decode the low-bit-rate audio into original PCM data through the microprocessor, convert it into an analog signal through the audio codec circuit, and then use the power amplifier circuit to amplify the power to drive the audio output device to sound; The human-computer interaction circuit is used to input and display information.

2. The full-duplex intercom device based on RS485 bus according to claim 1, characterized in that: The digital isolation circuit utilizes a photoelectric coupler to convert the input signal into an optical signal through the photoelectric coupler, and then converts it into a digital signal, thereby isolating the electrical connection between the RS485 input signal and the output signal.

3. The full-duplex intercom device based on RS485 bus according to claim 1, characterized in that: The RS485 bus and audio bus use twisted pair cable as the transmission medium. The RS485 transceiver circuit is based on the serial communication 485 chip. When sending, the data signal in the microprocessor is converted into a differential signal through the 485 chip and transmitted to the receiving end through the RS485 bus. The receiving end receives the differential signal through the 485 chip and converts it into a digital signal, which is input into the microprocessor for analysis.

4. The full-duplex intercom device based on RS485 bus according to claim 1, characterized in that: The analog audio circuit uses an operational amplifier, capacitors and resistors to build an audio noise reduction circuit to reduce electromagnetic interference introduced by the audio signal during transmission.

5. The full-duplex intercom device based on RS485 bus according to claim 1, characterized in that: The power amplifier circuit comprises two-stage amplifier circuits. The first stage is an audio signal amplitude amplifier circuit, which is used to amplify the amplitude of the audio signal by 5 times and then output it to the second stage power amplifier circuit to increase the voltage amplification factor.

6. The full-duplex intercom device based on RS485 bus according to claim 1, characterized in that: The human-computer interaction circuit includes an LED light, a screen and a button. The LED light is used as a status light to display the system status. The screen is used to display system operation data, local device ID, and process information. The button is used to input information.

7. A full-duplex intercom method based on RS485 bus, characterized in that: The following steps are involved: S1: Initialize the audio codec, serial port, screen and corresponding IO port. After the initialization is completed, it enters the sleep state and waits to be woken up; S2: First, wake up regularly to update screen information, including power level and device operation status, and then enter sleep mode after the update. S3: When a key is triggered, it enters the working state. First, the target device number is sent through RS485 according to the key input, and the target intercom device is waited for to respond. If no response signal is received for a period of time, it continues to enter the dormant state; if a response is received, it enters the intercom process; S4: After receiving the target device number transmitted by the RS485 bus, the other intercom devices determine whether it is the same as the target device number of this device. If not, they continue to return to the sleep state. If it is the same as the device number of this device, this device is the target intercom device, and the response is initiated by pressing the button to enter the full-duplex intercom process; S5: After the intercom process is finished, the intercom device enters a dormant state, waits for the next wake-up, and returns to step S1.

8. The full-duplex intercom method based on RS485 bus according to claim 7, characterized in that: The full-duplex intercom process includes the following steps: S41: The initiating intercom device inputs the target device number by pressing a key to determine the target intercom device, and sends the device number to the RS485 bus. At the same time, the initiating intercom device starts ringing, and the display screen shows calling; S42: The other intercom devices receive the data on the RS485 bus. If their own device number is the same as the target device number, the target intercom device starts ringing, and the call information is displayed on the screen. After confirming the answer by pressing the button, the answer command is sent to the RS485 bus, and then the intercom starts. At this time, the screen displays "Intercom in progress", and the full-duplex intercom process is successfully established; S43: After actively initiating the intercom device and receiving a response, the screen displays "intercom is in progress", collects microphone data, passes through an analog audio amplifier circuit, amplifies the analog audio amplitude by 20 times, and then transmits the audio data through an analog bus; S44: After receiving the analog audio data, the target intercom device directly drives the speaker to sound through the power amplifier circuit, and collects the audio data of its own microphone at the same time, converts the analog audio signal into a digital signal through the A / D converter, obtains the encoded audio bit stream through the low bit rate audio encoding algorithm in the microprocessor, and then transmits it to the RS485 bus; S45: After the intercom device actively initiates the acquisition of the audio bit stream, it is transmitted to the microprocessor, and the low bit rate audio decoding algorithm is used to synthesize the voice into digital audio data, which is converted into analog audio through D / A and sent by the power amplifier circuit to drive the speaker, thus completing a full-duplex intercom. S46: When the intercom needs to be ended, either party initiates an end intercom command by pressing a button, which is transmitted through the RS485 bus. After the other party obtains the end command, it replies with an answer command, and the full-duplex intercom ends.

9. The full-duplex intercom method based on RS485 bus according to claim 8, characterized in that: The low bit rate audio coding algorithm in the microprocessor comprises the following steps: A1: Preprocessing: The original speech signal is filtered through a high-pass filter with a cutoff frequency of 60Hz to remove the DC cost and 50Hz low-frequency interference, and three 25ms speech frames are combined into a super frame; A2: The pre-processed speech signal is roughly estimated to obtain pitch. The high-frequency interference in the pitch period is removed by a low-pass filter. The accuracy of the pitch period is then calculated using the difference formula to obtain an accurate pitch period value. The pitch period is then uniformly quantized to distinguish between unvoiced and voiced sounds. A3: Use the multi-band mixed excitation algorithm to further distinguish between unvoiced and voiced sounds, divide the signal into five sub-band signals through five bandpass filters, calculate their unvoiced intensity values ​​respectively, and quantify the results according to the correlation coefficient of each sub-band; A4: Then, the extracted coefficients are transformed into corresponding LSP parameters using a multi-level vector quantization algorithm, and the LSP parameters are arranged in ascending order according to the minimum interval size to complete the quantization of the linear prediction coefficients; A5: Calculate the residual signal from the quantized prediction coefficients, fill it with 512 sample values ​​using a Hamming window with a window length of 200, and perform fast Fourier transform and quantization. A6: The final encoded bit number is 90 baud, a super frame length is 75ms, and the encoding rate is 1200b / s bit stream.

10. The full-duplex intercom method based on RS485 bus according to claim 8, characterized in that: The low bit rate audio decoding algorithm comprises the following steps: B1: Analyze the speech frame bit stream information. If the two bits of the period bit are 1, it means the frame is discarded. If all bits are 0 or only one is 1, it is an unvoiced frame. Otherwise, it is a voiced frame. B2: Add attenuation when gain decoding is restored, where the ambient noise is calculated as follows: Among them G n is the environmental noise, G up =0.0337435, G down =0.135418, G1 is the decoding gain in the pitch period; B3: Perform synchronous interpolation processing on the decoded fundamental tone, reconstruct the integrity of the decoded parameters, and adopt different interpolation strategies according to the gain parameters, LSF parameters, pulse and noise coefficients of the mixed excitation, and the spectrum tilt coefficient of the adaptive enhancement filter; B4: Superimpose multiple excitation signals, calculate the pulse excitation using the inverse discrete Fourier transform algorithm, cyclically shift the pulse excitation by 10 bits, and then multiply it by the square root of the fundamental frequency period; B5: Use the adaptive enhancement filter to improve the distorted signal, and finally filter it through the linear synthesis filter to obtain the final synthesized speech signal.

Citation Information

Patent Citations

  • Main control system of vehicle-mounted broadcasting equipment

    CN104113384A

  • Novel low-cost analog-digital hybrid visual intercom multi-indoor-unit system

    CN113301305A

  • Digital broadcast interphone

    CN212413146U

  • Novel low-cost analog-to-digital hybrid visual intercom digital switch

    CN214707895U

  • Audio device

    US20070124150A1