A full-duplex intercom device and method based on RS485 bus
By combining the full-duplex intercom device and method of the RS485 bus and the analog audio bus, the problems of high power consumption, high cost, weak anti-interference ability and complex installation of underground intercom devices are solved, and low-power, low-cost, long-distance full-duplex intercom is achieved, with a transmission distance of up to 5km.
Patent Information
- Application Number
- CN202411680885.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-11-22
AI Technical Summary
Existing underground intercom devices have the problems of high power consumption, high cost, weak anti-interference ability, complex installation and inability to achieve full-duplex intercom.
The RS485 bus and analog audio bus are combined to transmit the initiator's audio data through the analog bus and the low-bit-rate audio data through the RS485 bus. The low-bit-rate audio codec algorithm is used to achieve full-duplex intercom, and the electrical connection is isolated by the digital isolation circuit. The full-duplex intercom process is controlled by a microprocessor.
It realizes low power consumption, low cost, long-distance full-duplex intercom, is easy to install, has strong anti-electromagnetic interference ability, and the transmission distance can reach 5km.
Smart Images

Figure CN119676614B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of broadcast systems for coal mines and relates to a full-duplex intercom device and method based on an RS485 bus. Background Art
[0002] Mine radio intercoms, as a key component of the emergency broadcast system within the "six major systems" for coal mine safety and risk avoidance, are essential tools for daily production operations, disaster prevention and risk avoidance, and emergency rescue in major coal mines. Currently, underground intercom systems primarily utilize fiber optic transmission, CAN bus transmission, and analog audio transmission. Fiber optic transmission intercoms: While capable of full-duplex intercoms, these systems consume high power, cannot meet long-distance power requirements, and are expensive. Furthermore, they rely on optical cable transmission and cannot be used in locations where fiber splicing is inconvenient, making them immobile. CAN bus transmission intercoms: These systems can only achieve half-duplex intercoms, resulting in low intercom efficiency. On-site installation and wiring must strictly adhere to CAN bus rules and standards. When multiple branches are involved, impedance matching requirements are high, requiring adjustment of terminal resistances, making on-site debugging inconvenient. Analog bus transmission intercoms: These systems transmit analog signals directly on the bus, have weak anti-interference capabilities, and are susceptible to electromagnetic interference underground, resulting in poor sound quality during transmission. Summary of the Invention
[0003] In view of this, an 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, comprising 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 sequentially connected to the power amplifier circuit and the audio output device; the analog audio circuit is also connected to the power amplifier circuit; the digital isolation circuit is sequentially connected to the RS485 transceiver circuit and the RS485 bus; 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 via 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 via 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 produce sound;
[0009] The human-computer interaction circuit is used to input and display 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 and converts it into a digital signal, which is input into the microprocessor for analysis.
[0012] Furthermore, an audio noise reduction circuit is constructed using an operational amplifier, capacitors and resistors 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, local device ID, and process information. 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 initialization is completed, it enters the sleep state and waits to be woken up;
[0017] S2: First, the device wakes up at a scheduled time to update the screen information, including the power level and device operating status. After the update, it continues to enter the sleep state;
[0018] S3: When a key is triggered, it enters the working state. First, it sends the target device number through RS485 according to the key input and waits for the target intercom device 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 the local device. If not, they continue to return to the dormant state. If it is the same as the device number of the local device, the local device is the target intercom device, and the response is initiated by pressing the key to enter the full-duplex intercom process;
[0020] S5: After the intercom process ends, the intercom device enters a dormant state, waits for the next wake-up, and returns to step S1.
[0021] Furthermore, 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 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 displays the incoming call information on the screen. After confirming the answer by pressing the button, the answer command is sent to the RS485 bus and then the intercom begins. At this time, the screen displays "Intercom in Progress". At this time, the full-duplex intercom process is successfully established.
[0024] S43: After the intercom device actively initiates the intercom and receives a response, the screen displays "Intercom in Progress" and collects microphone data. The analog audio amplifier circuit amplifies the analog audio amplitude by 20 times and then transmits the audio data through the 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 at the same time collects the audio data from its own microphone, 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, where it uses a low-bit-rate audio decoding algorithm to synthesize the speech into digital audio data. This is then converted into analog audio via a D / A converter and sent out via a power amplifier circuit to drive the speaker, completing a full-duplex intercom session.
[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 receives the end command, it replies with an answer command, and the full-duplex intercom ends.
[0028] Furthermore, the low bit rate audio coding algorithm in the microprocessor includes the following steps:
[0029] A1: Preprocessing: The original speech signal is filtered through a high-pass filter with a cutoff frequency of 60 Hz to remove the DC component and 50 Hz low-frequency interference. Three 25 ms speech frames are combined into a super frame.
[0030] A2: A rough pitch estimation is performed on the preprocessed speech signal. High-frequency interference in the pitch period is removed through a low-pass filter. The accuracy of the pitch period is then calculated using a 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: A multi-band mixed excitation algorithm is used to further distinguish between unvoiced and voiced sounds. The signal is divided into five sub-band signals through five bandpass filters. The unvoiced intensity value is calculated for each sub-band and the result is quantified based on 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. 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 using 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 75 ms, and the encoding rate is 1200 b / s bit stream.
[0035] Furthermore, the low bit rate audio decoding algorithm comprises the following steps:
[0036] B1: Analyze the speech frame bit stream information. If both period bits are 1, 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 during gain decoding and recovery, where the ambient noise is calculated as follows:
[0038]
[0039] Among them G n is the ambient 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 decoding parameter integrity, and adopt different interpolation strategies based on the gain parameter, LSF parameter, pulse and noise coefficient of the mixed excitation, and spectral 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. By organically combining the RS485 bus and the analog audio bus, the initiator’s audio data is transmitted via the analog bus and the target’s audio data is transmitted 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. Amplified analog audio data can be transmitted via 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. Using cables as the transmission medium, RS485 transmits encoded audio data at a baud rate of 2400bps. The bus is less affected by impedance matching and can be branched arbitrarily. Analog buses can also be wired arbitrarily.
[0048] Other advantages, objects, and features of the present invention will be described in part in the following description and, in part, will be apparent to those skilled in the art upon examination of the following description or may be learned from practice of the present invention. The objects and other advantages of the present invention may 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 with reference to the accompanying drawings, in which:
[0050] Figure 1 This is the schematic diagram of a 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 the 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 means of 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 are only schematic illustrations of the basic concept of the present invention, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0056] Among them, the accompanying drawings are only for illustrative purposes and represent only schematic diagrams rather than actual pictures, and should not be understood as limiting the present invention. In order to better illustrate the embodiments of the present invention, some parts of the accompanying drawings may be omitted, enlarged or reduced, and do not represent the dimensions of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions may be omitted in the accompanying drawings.
[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 there are terms such as "upper", "lower", "left", "right", "front", "back", etc. indicating directions or positional relationships, they are based on the directions or positional relationships shown in the drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operate in a specific direction. Therefore, the terms describing the positional 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 the RS485 bus. This device utilizes a combination of the RS485 bus and an analog bus to achieve long-distance, real-time, full-duplex intercom. The RS485 bus transmits compressed, low-bitrate audio data, while the analog bus directly transmits analog audio data. The device comprises 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 this full-duplex intercom method, each device has its own unique device number. To initiate an intercom with a specific device, the target intercom device is determined through key dialing in the human-computer interaction process. The target device number is then transmitted to the corresponding device via the RS485 bus. Once the target device confirms the intercom, the intercom can be initiated. The device that initiates the intercom first captures raw analog audio data from a microphone, directly amplifies it through an audio amplifier circuit, passes it through an analog audio circuit, and then transmits it via the analog audio bus. When the target device receives the analog audio data via the analog audio circuit, it is directly transmitted to the power amplifier circuit, driving a speaker for sound. When the target intercom device responds, it collects microphone audio data, converts it through an audio amplifier and audio codec circuit, and obtains raw PCM data. A low-bitrate audio coding algorithm is then used in a microprocessor to pre-process, quantize, and encode it into 1.2 kbit / s audio data. This data is then transmitted via the 2400 bps RS485 bus. After receiving the compressed audio data via the RS485 bus, the initiating intercom device performs low-bitrate audio decoding on the microprocessor to obtain the raw PCM data. This data is then converted into an analog signal via the audio codec circuit and then, using a power amplifier circuit, directly drives the speaker to produce sound. To end the intercom, either party can send an end command via the RS485 bus and receive a response, terminating the intercom process. This process enables long-distance full-duplex intercom. The full-duplex intercom device and method based on the RS485 bus organically combines digital and analog signals to achieve long-distance full-duplex intercom, offering advantages such as easy installation, low cost, and low power consumption.
[0059] Figure 1This is the schematic diagram of an intercom system. The power management circuit provides operating power to other circuits and can stably output two intrinsically safe DC voltages: 5V and 12V. The 5V is used to power the microprocessor, human-computer interaction circuit, audio codec circuit, digital isolation circuit, and RS485 transceiver circuit, while the 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, which is then converted into a digital signal. This effectively isolates the electrical connection between the RS485 input and output signals, preventing electrical interference generated during RS485 signal transmission. The RS485 bus and audio bus use twisted-pair cable as the transmission medium. The RS485 transceiver circuit is based on a serial communication 485 chip. During transmission, the data signal from the microprocessor is converted into a differential signal by the 485 chip and transmitted to the receiving end via the RS485 bus. The receiving end receives the differential signal through the 485 chip, converts it into a digital signal, and outputs it to the microprocessor for analysis. The analog audio circuit utilizes operational amplifiers, capacitors, and resistors to create an audio noise reduction circuit, minimizing electromagnetic interference introduced during audio signal transmission. The noise-reduced audio signal then passes through a power amplifier circuit, driving an 8Ω, 10W speaker for sound. The power amplifier circuit comprises two stages. The first stage, an audio signal amplitude amplifier, amplifies the audio signal by 5 times before outputting it to the second stage, increasing the voltage gain. The maximum output power is 15W, sufficient to drive an 8Ω, 10W speaker. The audio amplifier circuit captures the analog microphone signal and amplifies it by 20 times. Depending on the application, the signal can be directly transmitted to the analog bus via the analog audio circuit or converted to a digital signal via an audio codec circuit through A / D conversion for transmission to a microprocessor. The human-computer interface circuit includes an LED, a screen, and buttons. The LED serves as a status indicator, displaying system status. The screen displays system operating data, the local device ID, and process information. The buttons are used for inputting information. 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 through a high-pass filter with a cutoff frequency of 60 Hz to remove the DC component 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 subjected to a rough pitch estimation. High-frequency interference in the pitch period is removed through 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 a multi-band mixed excitation algorithm to more accurately distinguish between unvoiced and voiced sounds. Split the signal into five sub-band signals through five bandpass filters, calculate the unvoiced intensity value of each sub-band, and quantify the result based on 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 the parameters 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 using the quantized prediction coefficients, 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 encoded bits 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 periodic bits 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: To reduce environmental noise interference, 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 ambient noise, G up =0.0337435, G down =0.135418, G1 is the decoding gain in the fundamental frequency period.
[0075] S3: Further synchronous interpolation processing is performed on the decoded fundamental tone to reconstruct the integrity of the decoded parameters, and different interpolation strategies are adopted according to the gain parameters, LSF parameters, pulse and noise coefficients of the mixed excitation, and spectral tilt coefficients 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 pitch 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 the final synthesized speech signal.
[0078] II Full-duplex intercom process
[0079] The full-duplex intercom devices connected to the same RS485 bus have their own unique device number. The intercom devices are connected through 4-core twisted pair shielded cables. 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 the 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 intercom 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 start. At this time, the screen shows "Intercom in Progress", and the full-duplex intercom process is successfully established.
[0082] S3: After the intercom device is actively initiated and receives a response, the screen displays "Intercom in Progress" and starts collecting microphone data. The analog audio amplitude is amplified 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 at the same time collects the audio data from its own microphone. The analog audio signal is converted into a digital signal through the A / D converter, and the encoded audio bit stream is obtained through the low-bit-rate audio encoding algorithm in the microprocessor, which is then transmitted 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-bit-rate voice 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 initialization is completed, it enters the sleep state and waits to be woken up;
[0089] S2: First, the device wakes up at a scheduled time to update the screen information, including the power level and device operating status. After the update, it continues to enter the sleep state;
[0090] S3: If a key is triggered, it enters the working state. First, it sends the target device number through RS485 according to the key input and waits for the target intercom device to respond. 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 intercom 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 dormant 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 ends, the intercom device enters the dormant 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 solutions of the present invention and are not limiting. 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 solutions of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions, which should all be included in the scope of the claims of the present invention.
Claims
1. A full-duplex intercom device based on RS485 bus, characterized by: 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 sequentially connected to the power amplifier circuit and the audio output device; the analog audio circuit is also connected to the power amplifier circuit; the digital isolation circuit is sequentially connected to the RS485 transceiver circuit and the RS485 bus; 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 via 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 via 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 produce sound; The human-computer interaction circuit is used to input and display information; When the active intercom device initiates an intercom to the target intercom device, it collects the original analog audio data of the audio input device, directly amplifies the amplitude through the audio amplifier circuit, and then transmits it to the target intercom device via the audio bus after passing through the analog audio circuit; After the target intercom device receives the analog audio data, it is transmitted to the power amplifier circuit for power amplification, and drives the audio output device to produce sound; When the target intercom device replies to the actively initiating intercom device, it collects the original analog audio data of the audio input device, amplifies the amplitude through the audio amplifier circuit, and then converts it into original PCM data through the audio codec circuit. The microprocessor performs low-bit-rate audio encoding into low-bit-rate audio data, and then the digital isolation circuit isolates the electrical connection between the input signal and the output signal. Finally, after passing through the RS485 transceiver circuit, it is transmitted to the actively initiating intercom device via the RS485 bus. After the actively initiating intercom device receives the low-bit-rate audio data, the digital isolation circuit isolates the electrical connection between the input signal and the output signal, and then the microprocessor performs low-bit-rate audio decoding into original PCM data, which is converted into an analog signal through the audio codec circuit. Subsequently, the power amplifier circuit performs power amplification to drive the audio output device to produce sound.
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, converts it into a digital signal, and inputs it 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 utilizes an operational amplifier, capacitors, and resistors to construct an audio noise reduction circuit to reduce electromagnetic interference introduced during the transmission of audio signals.
5. The full-duplex intercom device based on RS485 bus according to claim 1, characterized in that: The power amplifier circuit includes two stages of 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 serves 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 initialization is completed, it enters the sleep state and waits to be woken up; S2: First, the device wakes up at a scheduled time to update the screen information, including the power level and device operating status. After the update, it continues to enter the sleep state; S3: When a key is triggered, it enters the working state. First, it sends the target device number through RS485 according to the key input and waits for the target intercom device 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 the local device. If not, they continue to return to the dormant state. If the device number is the same as the local device number, the local device is the target intercom device, and the response is confirmed by pressing the key to enter the full-duplex intercom process. 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 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 displays the incoming call information on the screen. After confirming the answer by pressing the button, the answer command is sent to the RS485 bus and then the intercom begins. At this time, the screen displays "Intercom in Progress". At this time, the full-duplex intercom process is successfully established. S43: After the intercom device actively initiates the intercom and receives a response, the screen displays "Intercom in Progress" and collects microphone data. The analog audio amplifier circuit amplifies the analog audio amplitude by 20 times and then transmits the audio data through the 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 at the same time collects the audio data from its own microphone, 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, where it uses a low-bit-rate audio decoding algorithm to synthesize the speech into digital audio data. This is then converted into analog audio via a D / A converter and sent out via a power amplifier circuit to drive the speaker, completing a full-duplex intercom session. S46: When the intercom needs to be ended, either party initiates an end intercom command by pressing a button, which is transmitted via the RS485 bus. After the other party receives the end command, it replies with an answer command, and the full-duplex intercom ends. S5: After the intercom process ends, 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, wherein: 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 60 Hz to remove the DC component and 50 Hz low-frequency interference. Three 25 ms speech frames are combined into a super frame. A2: A rough pitch estimation is performed on the preprocessed speech signal. High-frequency interference in the pitch period is removed through a low-pass filter. The accuracy of the pitch period is then calculated using a difference formula to obtain an accurate pitch period value. The pitch period is then uniformly quantized to distinguish between unvoiced and voiced sounds. A3: A multi-band mixed excitation algorithm is used to further distinguish between unvoiced and voiced sounds. The signal is divided into five sub-band signals through five bandpass filters. The unvoiced intensity value is calculated for each sub-band and the result is quantified based on 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. 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 using 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 75 ms, and the encoding rate is 1200 b / s bit stream.
9. The full-duplex intercom method based on RS485 bus according to claim 7, wherein: The low bit rate audio decoding algorithm comprises the following steps: B1: Analyze the speech frame bit stream information. If both period bits are 1, 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 during gain decoding and recovery, where the ambient noise is calculated as follows: Among them G n is the ambient 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 decoding parameter integrity, and adopt different interpolation strategies based on the gain parameter, LSF parameter, pulse and noise coefficient of the mixed excitation, and spectral 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
Digital broadcast interphone
CN212413146U