WO2016078271A1 - 信号的发送、接收方法及装置、系统 - Google Patents

信号的发送、接收方法及装置、系统 Download PDF

Info

Publication number
WO2016078271A1
WO2016078271A1 PCT/CN2015/074793 CN2015074793W WO2016078271A1 WO 2016078271 A1 WO2016078271 A1 WO 2016078271A1 CN 2015074793 W CN2015074793 W CN 2015074793W WO 2016078271 A1 WO2016078271 A1 WO 2016078271A1
Authority
WO
WIPO (PCT)
Prior art keywords
bit length
preset
preset bit
binary code
stream
Prior art date
Application number
PCT/CN2015/074793
Other languages
English (en)
French (fr)
Inventor
韩正渭
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016078271A1 publication Critical patent/WO2016078271A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis

Definitions

  • the present invention relates to the field of communications, and in particular, to a method and a device and system for transmitting and receiving signals.
  • PCM Pulse Code Modulation
  • I2S Inter-IC Sound, Inter-Chip Audio Interface
  • SPDIF Synchrony/Philips Digital Interface Format, Sony/Philips Digital Interface
  • PCM and I2S are very mature technologies, simple and reliable, and are widely used in audio interconnections inside devices. But these two interfaces have common defects: the first is that one-way audio requires three signal lines to transmit, the two-way audio requires four signal lines to transmit, which is slightly cumbersome; the second is that the interfaces on both sides must be clocked, bit width And the time slot configuration can work normally, and these configuration commands must pass through other control interfaces such as I2C (Inter-Integrated Circuit) or SPI (Serial Peripheral Interface). To achieve this, this will inevitably lead to a further increase in the number of connections, which is not conducive to the simplification of the circuit and low-cost design, and is not conducive to the miniaturization of the device.
  • I2C Inter-Integrated Circuit
  • SPI Serial Peripheral Interface
  • SPDIF is also a mature technology. It only needs a single signal line to transmit one-way audio signals, which is very beneficial for simplifying the interconnection between audio devices.
  • SPDIF also has obvious defects: First, the SPDIF protocol is more complicated, resulting in higher cost of circuits and software for both parties; second, SPDIF does not support direct transmission of signals of more than 2 channels, and must pass complex compression. Encoding can be implemented indirectly, further increasing software overhead, increasing processor load and increasing power consumption. For the above reasons, the current SPDIF is only used for inter-device interfaces, such as the interconnection between a stand-alone player and an independent power amplifier, which is generally not used in the interconnection inside the device.
  • the invention provides a method and a device and a system for transmitting and receiving signals, so as to at least solve the problem that audio data and control commands need to be transmitted through multiple signal lines in the related art.
  • a method for transmitting a signal includes: dividing audio data to be transmitted or a control command for configuring an audio transmission process into N first preset bit length binary streams , N is an integer greater than 0; the binary code stream of the N first preset bit lengths is according to a preset rule Encoding a binary code stream of N second preset bit lengths, the second preset bit length being greater than the first preset bit length; starting from a binary code stream of at least one of the second preset bit lengths a start position setting data frame start flag SOFA or a control frame start flag SOFC, generating M data frames or M control frames, wherein the SOFA corresponds to the audio data, and the SOFC corresponds to the control command, M is not greater than N; the M data frames or M control frames are output through a single line output interface.
  • the first preset bit length is 4 bits
  • the second preset bit length is 5 bits
  • the N first preset bit length binary code streams are coded according to a preset rule as a binary code stream of the second preset bit length, comprising: expanding the binary code stream of the N first preset bit lengths into a binary code stream of the N second preset bit lengths, where The binary code stream of the second preset bit length includes 1 and 0, and the binary code stream of the second preset bit length does not include consecutive three 1s, and if the second preset bit length The first bit of the binary code stream is 1, and the second bit of the binary code stream of the second preset bit length is 0; if the last bit of the binary code stream of the second preset bit length is 1 And the second-order bit of the binary code stream of the second preset bit length is 0.
  • the SOFA and the SOFC are both 0 bits of the first bit and include a stream of three consecutive 1 bit codes.
  • a method for receiving a signal includes: receiving M data frames or M control frames through a single line input interface, each of the M data frames or the M control frames a binary code stream including at least one second preset bit length, and a data frame start flag SOFA or a control frame start flag SOFC set at a start position of the binary code stream of the second preset bit length, where The SOFA corresponds to the data frame, the SOFC corresponds to the control frame, and the M data frames or the M control frames are decoded into N binary preset bit length binary according to a preset rule.
  • a code stream the second preset bit length is greater than the first preset bit length, N is an integer greater than 0, and M is not greater than N.
  • both the SOFA and the SOFC are 0 bits of the first bit and include a stream of three consecutive 1 bit codes.
  • the first preset bit length is 4 bits
  • the second preset bit length is 5 bits
  • the M data frames or the M control frames are decoded into N according to a preset rule.
  • a binary code stream of a first preset bit length comprising: decoding the M data frames or the M control frames into the N first first preset bit length binary code streams, where The binary code stream of two preset bit lengths includes 1 and 0, and the binary code stream of the second preset bit length does not include consecutive three 1s, and if the second preset bit length is binary code The first bit of the stream is 1, and the second preset bit length of the binary stream The two bits are 0, and if the last bit of the binary stream of the second predetermined bit length is 1, the second-to-last bit of the binary stream of the second predetermined bit length is zero.
  • a transmitting apparatus comprising: a data grouping unit configured to divide audio data to be transmitted or a control command for configuring an audio transmission process into N first preset bits a binary code stream of length, N is an integer greater than 0; and a coding unit configured to encode the binary code streams of the N first preset bit lengths into binary codes of N second preset bit lengths according to a preset rule Flow, the second preset bit length is greater than the first preset bit length; setting a data frame start flag SOFA or a control frame at a start position of the at least one second preset bit length binary code stream Initially marking the SOFC, generating M data frames or M control frames, wherein the SOFA corresponds to the audio data, the SOFC corresponds to the control command, M is not greater than N; and an output unit is configured to M data frames or M control frames are output through a single line output interface.
  • the coding unit is configured to expand the N first first preset bit length binary code streams into the N second preset bit length binary code streams, where the second preset a bit length binary code stream containing 1 and 0, and the second preset bit length binary code stream does not include consecutive three 1s, and if the second preset bit length of the binary code stream a bit of 1, the second bit of the binary bit stream of the second predetermined bit length is 0, and if the last bit of the binary bit stream of the second preset bit length is 1, the first bit The second-order bit of the binary bit stream of the two preset bit lengths is 0; the SOFA and the SOFC are both 0 bits of the first bit and include a stream of three consecutive 1 bit streams.
  • a receiving apparatus comprising: a receiving unit configured to receive M data frames or M control frames, the M data frames or the M control frames through a single line input interface
  • Each of the binary code streams including at least one second predetermined bit length, and a data frame start flag SOFA or a control frame start flag SOFC set at a start position of the binary code stream of the second predetermined bit length
  • the SOFA corresponds to the data frame
  • the SOFC corresponds to the control frame
  • N is an integer greater than 0, and M is not greater than N
  • the decoding unit is configured to set the M data frames or the
  • the M control frames are decoded into a binary code stream of N first preset bit lengths according to a preset rule, and the second preset bit length is greater than the first preset bit length.
  • the decoding unit is configured to decode the M data frames or the M control frames into the N first first preset bit length binary code streams, where the second preset bits The length binary code stream contains 1 and 0, and the second preset bit length binary code stream does not include consecutive three 1s, and if the second preset bit length of the binary code stream is first Bit 1 is, the second bit of the binary bit stream of the second preset bit length is 0, and if the last bit of the binary bit stream of the second preset bit length is 1, the second bit The penultimate bit of the binary bit stream of the preset bit length is zero.
  • a signal interaction system comprising: a processor configured to divide audio data to be transmitted or a control command for configuring an audio transmission process into N first preset bits a length binary stream, N is an integer greater than 0; encoding the N first preset bit length binary code streams into N binary predetermined bit length binary code streams according to a preset rule, where The second preset bit length is greater than the first preset bit length; the data frame start flag SOFA or the control frame start flag SOFC is set at a start position of the at least one second preset bit length binary code stream, and the generated M data frames or M control frames, wherein the SOFA corresponds to the audio data, the SOFC corresponds to the control command, M is not greater than N; and the M data frames or M control frames are passed The single line output interface is transmitted to the audio decoder;
  • the audio decoder is configured to receive the M data frames or the M control frames by using a single-line input interface; and decode the M data frames or the M control frames into the N according to a preset rule.
  • the audio data or the control command to be sent is encoded according to a preset rule, and the data frame start flag or the control frame start flag is set at the start position of the encoded binary code stream, and then is output through a single line.
  • the technical solution for the interface to transmit The problem that the audio data and the control command need to be transmitted through multiple signal lines in the related art is solved, thereby achieving the effects of simplifying the circuit and miniaturizing the device.
  • FIG. 1 is a schematic flow chart of a method for transmitting a signal according to an embodiment of the present invention
  • FIG. 2 is a schematic flow chart of a method for receiving a signal according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a transmitting apparatus according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a receiving apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a signal interaction system according to an embodiment of the present invention.
  • Figure 6 is a block diagram of a basic circuit in accordance with an embodiment of the present invention.
  • FIG. 7 is a hardware logic block diagram of a transmitting side according to an embodiment of the present invention.
  • FIG. 8 is a hardware logic block diagram of a receiving side according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of a workflow according to an embodiment of the present invention.
  • first and second in the embodiments of the present invention are only used for distinguishing, and are not used for defining the order or priority.
  • An embodiment of the present invention provides a method for transmitting a signal. As shown in FIG. 1, the method includes the following steps:
  • the binary code streams of the N first preset bit lengths are coded into a binary code stream of N second preset bit lengths according to a preset rule, where the second preset bit length is greater than the first preset bit length.
  • S106 Set a data frame start flag SOFA or a control frame start flag SOFC at a start position of the at least one second preset bit length binary code stream to generate M data frames or M control frames, where the SOFA corresponds to Audio data, SOFC corresponds to control command, M is not greater than N;
  • the binary stream of the second preset bit length does not include SOFA (START OF FRAME-AUDIO, data frame start flag) or SOFC (START OF FRAME-COMMAND, control frame start flag), that is, the first
  • the binary bit stream of the second preset bit length is encoded differently from the SOFA or SOFC, thereby ensuring the uniqueness of the SOFA and the SOFC, and facilitating the detection of the SOFA and the SOFC using a simple circuit.
  • the plurality of second preset length bit code streams may correspond to one SOFA or SOFC.
  • the audio data or the control command to be sent is encoded according to a preset rule, and the data frame start flag or the control frame start flag is set at the start position of the encoded binary code stream.
  • the N code streams of the first preset bit length are coded into a binary code stream of N second preset bit lengths according to a preset rule, including: a binary code stream of N first preset bit lengths Expanding into a binary code stream of N second preset bit lengths, wherein the binary code stream of the second preset bit length includes 1 and 0, and the binary code stream of the second preset bit length does not include consecutive three 1 and if the first bit of the binary stream of the second predetermined bit length is 1, the second bit of the binary stream of the second predetermined bit length is 0, and if the second preset bit length is binary The last bit of the code stream is 1, and the second last bit of the binary stream of the second predetermined bit length is zero.
  • a preset rule including: a binary code stream of N first preset bit lengths Expanding into a binary code stream of N second preset bit lengths, wherein the binary code stream of the second preset bit length includes 1 and 0, and the binary code stream of the second preset bit length does not include consecutive three 1 and if
  • both the SOFA and the SOFC have a first bit of 0 and contain a continuous three bit stream of one. This in turn ensures the uniqueness of SOFA and SOFC, making it easy to detect SOFA and SOFC using simple circuits.
  • transmitting the M data frames or the M control frames to the audio decoder through the single-wire output interface comprises: converting M data frames or M control frames into serial frames, and transmitting the serial frames through the single-wire output interface To the audio decoder.
  • serial frames are formed in a predetermined format and transmitted on a single signal line.
  • the first preset bit length is 4 bits
  • the second preset bit length is 5 bits.
  • the embodiment of the invention further provides a method for receiving a signal. As shown in FIG. 2, the method includes the following steps:
  • S202 Receive, by using a single-line input interface, M data frames or M control frames, where each of the M data frames or the M control frames includes at least one binary code stream of a second preset bit length, and is set in the second preset.
  • a data frame start flag SOFA or a control frame start flag SOFC of a start position of a bit length binary code stream wherein the SOFA corresponds to the data frame, and the SOFC corresponds to the control frame;
  • S204 Decode M data frames or M control frames into N binary code streams of a first preset bit length according to a preset rule, where the second preset bit length is greater than the first preset bit length N is an integer greater than 0. , M is not greater than N.
  • the M data frames or the M control frames are decoded into N binary code streams of the first preset bit length according to a preset rule, including: decoding M data frames or M control frames into N first frames.
  • a binary bit stream of a preset bit length wherein the binary code stream of the second preset bit length includes 1 and 0, and the binary code stream of the second preset bit length does not include consecutive three 1s, and if The first bit of the binary bit stream of the second preset bit length is 1, and the second bit of the binary code stream of the second preset bit length is 0, and if the last bit of the binary code stream of the second preset bit length is If 1, the second-to-last bit of the binary stream of the second predetermined bit length is zero.
  • both the SOFA and the SOFC have a first bit of 0 and contain a continuous three bit stream of one.
  • the first preset bit length is 4 bits
  • the second preset bit length is 5 bits.
  • the embodiment of the invention further provides a transmitting device. As shown in FIG. 3, the device includes:
  • the data grouping unit 302 is configured to divide the audio data to be transmitted or the control command for configuring the audio transmission process into N binary code streams of a first preset bit length, where N is an integer greater than 0;
  • the encoding unit 304 is configured to encode the binary code streams of the N first preset bit lengths into a binary code stream of N second preset bit lengths according to a preset rule, where the second preset bit length is greater than the first preset bit length Length; setting a data frame start flag SOFA or a control frame start flag SOFC at a start position of the at least one second preset bit length binary code stream, generating M data frames or M control frames, wherein the SOFA corresponds to Audio data, SOFC corresponds to a control command;
  • the output unit 306 is configured to transmit the M data frames or the M control frames to the audio decoder through the single line output interface.
  • the encoding unit 304 is configured to expand the N first preset bit length binary code streams into N second preset bit length binary code streams, wherein the second preset bit length in the binary code stream 1 and 0 are included, and the binary code stream of the second preset bit length does not include consecutive three 1s, and if the first bit of the binary stream of the second preset bit length is 1, the second preset bit The second bit of the binary stream of length is 0, and if the last bit of the binary stream of the second predetermined bit length is 1, the second to last bit of the binary stream of the second predetermined bit length is zero.
  • both the SOFA and the SOFC have a first bit of 0 and contain a continuous three bit stream of one.
  • the output unit 306 is configured to serially output M data frames or M control frames through a single line output interface.
  • the embodiment of the invention further provides a receiving device. As shown in FIG. 4, the device includes:
  • the receiving unit 402 is configured to receive M data frames or M control frames by using a single-line input interface, where N is an integer greater than 0, and each of the M data frames or the M control frames includes at least one second preset bit length. a binary code stream, and a data frame start flag SOFA or a control frame start flag SOFC set at a start position of the binary code stream of the second preset bit length, wherein the SOFA corresponds to the data frame, and the SOFC corresponds to the control frame;
  • the decoding unit 404 is configured to decode the M data frames or the M control frames into a binary code stream of N first preset bit lengths according to a preset rule, where the second preset bit length is greater than the first preset bit length.
  • the decoding unit 404 is configured to decode the M data frames or the M control frames into N binary code streams of a first preset bit length, where the binary stream of the second preset bit length includes 1 and 0, and the binary stream of the second preset bit length does not include consecutive three 1s, and if the first bit of the binary stream of the second preset bit length is 1, the second preset bit length is binary The second bit of the code stream is 0, and if the last bit of the binary stream of the second predetermined bit length is 1, the second to last bit of the binary stream of the second predetermined bit length is zero.
  • the embodiment of the invention further provides a signal interaction system. As shown in FIG. 5, the system includes:
  • the processor 502 is configured to divide the audio data to be sent or the control command for configuring the audio transmission process into N binary code streams of a first preset bit length, where N is an integer greater than 0; a binary bit stream of a preset bit length is encoded into a binary code stream of N second preset bit lengths according to a preset rule, the second preset bit length is greater than the first preset bit length; and the at least one second preset bit is The start position of the binary stream of the length sets the data frame start flag SOFA or the control frame start flag SOFC to generate M data frames or M control frames, wherein the SOFA corresponds to the audio data, and the SOFC corresponds to the control command; M data frames or M control frames are transmitted to the audio decoder 504 through a single line output interface;
  • the audio decoder 504 is configured to receive M data frames or M control frames by using a single-line input interface; and decode M data frames or M control frames into N binary code streams of a first preset bit length according to a preset rule. .
  • the audio data or the control command to be sent is encoded according to a preset rule, and the data frame start flag or the control frame start flag is set at the start position of the encoded binary code stream, and then is output through a single line.
  • the technical solution for the interface to transmit The problem that the audio data and the control command need to be transmitted through multiple signal lines in the related art is solved, thereby achieving the effects of simplifying the circuit and miniaturizing the device.
  • the invention provides a novel audio signal interface, which can transmit a single direction audio signal by using a single signal line, supports multi-channel transmission, has variable bit width and sampling rate, and can configure configuration information (corresponding to the above control command) ) Send directly through the signal line without a separate configuration interface.
  • the coding method is much simpler than SPDIF, and the logic circuit and software overhead of the interface are low. It can be widely applied to the audio interconnection inside the device, replacing the original audio signal lines such as PCM and I2S, and canceling the original I2C or SPI, etc. Control signal lines, greatly simplifying the circuit.
  • the interface is implemented using the following technical means:
  • serial frames are formed in a predetermined format and transmitted on a single signal line.
  • SOF frame start flag
  • START OF FRAME a specific frame start flag
  • SOF There may be multiple (for example, SOFA and SOFB described above) for distinguishing frames into different categories.
  • frames may be classified into audio frames and command frames (corresponding to the above-mentioned control frames) for respectively transmitting audio. Data and control commands.
  • a preferred coding scheme is: first, the audio data and the control command are divided into a plurality of 4-bit length binary groups; secondly, the binary group is expanded to 5 bits, and the 5 bits satisfy the following three conditions: A) The code must contain 1 and 0, B) There are no consecutive 3 1s, C) There can be only 1 consecutive 1s at the beginning and the end; finally, a 5-bit code stream containing 3 consecutive 1s is used as the SOF.
  • the encoded data appended to the SOF, forms a frame that is transmitted to a single signal line for transmission by unipolar non-return-to-zero modulation or other baseband modulation methods.
  • the interface signal line has a default frame length, number of audio channels, and word width.
  • the communicating parties communicate in the default format.
  • the two parties can change the frame length, the number of audio channels and the word width through negotiation.
  • the basic circuit block diagram is shown in Figure 6.
  • the whole system consists of the processor system HOST SYSTEM, the audio decoder AUDIO CODEC, and the electro-acoustic device MIC (Microphone, microphone) / SPEAKER (micro speaker).
  • the main processor (equivalent to the above processor, hereinafter referred to as HOST) and the AUDIO CODEC use two unidirectional audio signal lines, one of which is transmitted from the main processor to the AUDIO CODEC as a host.
  • the other line is AUDIO CODEC (hereinafter referred to as CODEC) to the main processor for transmitting reverse control commands and MIC/SPEAKER receiving environment. sound.
  • the digitized audio signal is subjected to extended coding once every 4 bits, and is extended to 5 bits for transmission.
  • the coding follows the following rules:
  • Each code must contain 1 and 0 to ensure that the clock information is carried;
  • the encoded 5 bits do not appear consecutive 3 or more 1s.
  • the present embodiment stipulates that a bit stream 01110 (ie, 0EH in hexadecimal), 01111 (ie, 0FH in hexadecimal), and 01111 (ie, 07H in hexadecimal) including three consecutive 1s are used as SOF. Both bitstreams start with 0 and contain three consecutive 1's in the internal, which guarantees the uniqueness of the starting frame and facilitates the detection of SOF using a simple circuit.
  • 0EH is referred to as an audio frame flag (SOFA)
  • SOFC command frame flag
  • the default frame length is 25 bits
  • a physical layer communication rate of 200 kbps is used.
  • the audio code stream in the frame is first framed after being encoded and expanded, and the left and right channels appear to be 10 bits, but only carry 8 bits of valid information.
  • the command word is also encoded on the signal line after being encoded according to the above method.
  • the command word is 16 bits before encoding, and becomes 20 bits in the frame after encoding.
  • each frame Since the fixed length of each frame is 25 bits, according to the rate of 200 kbps, the data transmission of each frame occupies a time of 125 us, and when continuously transmitted without intervals, the corresponding frame frequency is 8 kHz.
  • the default audio signal is a two-channel, 8-bit quantization, 8 kHz sampling rate.
  • the effective bit width of the command frame is 16 bits.
  • specific command examples are shown in Table 4. The commands that do not appear in Table 4 are reserved.
  • the hardware logic block diagram on the transmitting side is as shown in FIG. 7.
  • the audio data and control commands enter the second-select switch, and all the way is selected as needed.
  • the selected data is further divided into groups of 4 bits (data packets), and then enters the encoder, and the 4-bit code is expanded to 5 bits.
  • the above 5-bit width data is again entered into a two-selection switch, and the switch can select one of the above-mentioned encoded 5-bit data and SOFA/SOFC, and select one of them according to the need, and output to the 5-bit shift register controlled by the clock unit. Signal line. When a transmission of 0 is required, the output logic is low, and when a transfer of 1 is required, the output logic is high.
  • the hardware logic block diagram of the receiving side is as shown in FIG. 8.
  • the clock unit uses the high and low transitions of the input signal to extract the phase information of the clock.
  • the receive clock drives a 5-bit shift register to produce binary data of 5 bits wide.
  • the SOF detection unit continuously detects 5 bits of the 5-bit shift register, and outputs an SOF/SOFA/SOFC signal upon detecting the SOFA or SOFC. Under the control of the SOF/SOFA/SOFC signal, the decoding unit and the data merging unit first decode the 5-bit wide data into 4 bits and merge them into the required parallel data.
  • the SOFA and SOFC signals also control the command input register and the audio buffer, respectively, and send the combined data to the command register or audio buffer.
  • the software After the reset, the software starts working, and sends a frame control command to the audio decoder through the single-wire interface to query whether the audio decoder supports the required format.
  • the top of the frame is the start flag (SOFC), followed by the CODEC query command 0112H, asking if the CODEC can support the dual channel / 8 kHz / 16 bit format.
  • the audio input signal line (from the CODEC to the HOST direction) still maintains the IDLE state, as shown in Table 7 and Table 8:
  • the CODEC sends a response command 0212H to reply to the host to support a 2-channel/8 kHz/16-bit data format.
  • HOST outputs the IDLE state, as shown in Table 9 and Table 10:
  • the host After receiving the response command from the CODEC, the host knows that the CODEC supports the dual channel/8 kHz/16 bit format.
  • the setup command 0312H is then sent to the audio decoder to set a new communication mode.
  • the CODEC After receiving the communication format update command, the CODEC also immediately configures the receiving circuit to the above frame format and communication rate.
  • the host sends a configuration command to the audio decoder with a new frame format to set the volume to the maximum, and the corresponding setting command is 047FH. Since the new frame length has become longer, the command does not take up the length and outputs IDLE. At this point, the audio input signal line still maintains the IDLE state, as shown in Table 15 and Table 16:
  • the CODEC After the CODEC receives and correctly decodes the volume setting command, it sets its own volume output to maximum, and sends a response message 04FFH to HOST. At this time, HOST is in the waiting state, and the output signal remains idle, as shown in Table 17 and Table 18. :
  • HOST After the HOST receives the response message from the CODEC, it starts to send audio data to the audio decoder, at which time the audio input signal line is in an idle state.
  • the audio data output by HOST is cyclic 5050H and A050H, and each data is sent twice, representing left channel and right channel respectively, as shown in Table 19 and Table 20:
  • the CODEC After receiving the 5050H and A050H of the above cycle, the CODEC outputs the square wave to the SPEAKER through an ADC (Analog-to-Digital Converter) and a power amplifier to emit an alarm sound.
  • ADC Analog-to-Digital Converter
  • a storage medium is further provided, wherein the software includes the above-mentioned software, including but not limited to: an optical disk, a floppy disk, a hard disk, an erasable memory, and the like.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the above embodiments and preferred embodiments solve the problem that the audio data and the control command need to be transmitted through multiple signal lines in the related art, thereby achieving the effects of simplifying the circuit and miniaturizing the device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Communication Control (AREA)

Abstract

本发明公开了一种信号的发送、接收方法及装置、系统,该发送方法包括:将待发送的音频数据或用于对音频传输过程进行配置的控制命令划分为N个第一预设比特长度的二进制码流,N为大于0的整数;将N个第一预设比特长度的二进制码流按照预设规则编码为N个第二预设比特长度的二进制码流,第二预设比特长度大于第一预设比特长度;在至少一个第二预设比特长度的二进制码流的起始位置设置数据帧起始标志SOFA或控制帧起始标志SOFC,生成M个数据帧或M个控制帧,其中,SOFA对应于音频数据,SOFC对应于控制命令;将M个数据帧或M个控制帧通过单线输出接口输出。通过本发明,解决了音频数据和控制命令需要通过多根信号线传输的问题。

Description

信号的发送、接收方法及装置、系统 技术领域
本发明涉及通信领域,具体而言,涉及一种信号的发送、接收方法及装置、系统。
背景技术
随着技术的发展,音频信号在设备内部和设备间的传输,越来越多的使用了数字化的方法,以避免模拟信号传输引入的噪声和失真。常用的数字音频格式包括PCM(Pulse Code Modulation,脉冲编码调制)、I2S(Inter-IC Sound,芯片间音频接口)和SPDIF(Sony/Philips Digital Interface Format,索尼/飞利浦数字接口)等。
PCM和I2S是很成熟的技术,简单可靠,大量应用于设备内部的音频互连。但这两种接口有共同的缺陷:第一是单向音频需要3个信号线传输,双向的音频需要4个信号线传输,稍嫌繁琐;第二是两侧的接口必须进行时钟,位宽和时隙的配置后才能正常工作,而这些配置命令又必须通过别的控制接口例如I2C(Inter-Integrated Circuit,芯片间互连接口)或者SPI(Serial Peripheral Interface,串行外设接口)等接口去实现,这必然造成连线数量的进一步增加,不利于电路的简化和低成本设计,也不利于设备的小型化。
SPDIF也是成熟的技术,它传输单向的音频信号只需要单个信号线,对简化音频设备间的互连非常有利。但是,SPDIF也有很明显的缺陷:第一,SPDIF协议比较复杂,导致通信双方的电路和软件成本较高;第二,SPDIF不支持多于2个声道的信号直接传输,必须通过复杂的压缩编码才能间接实现,进一步增加软件开销、加大处理器负担并增加功耗。 由于上述的原因,目前SPDIF仅用于设备间接口,例如独立的播放器和独立功放之间的互连,在设备内部的互连中一般不用。
发明内容
本发明提供了一种信号的发送、接收方法及装置、系统,以至少解决相关技术中音频数据和控制命令需要通过多根信号线传输的问题。
根据本发明的一个方面,提供了一种信号的发送方法,包括:将待发送的音频数据或用于对音频传输过程进行配置的控制命令划分为N个第一预设比特长度的二进制码流,N为大于0的整数;将所述N个第一预设比特长度的二进制码流按照预设规则 编码为N个第二预设比特长度的二进制码流,所述第二预设比特长度大于所述第一预设比特长度;在至少一个所述第二预设比特长度的二进制码流的起始位置设置数据帧起始标志SOFA或控制帧起始标志SOFC,生成M个数据帧或M个控制帧,其中,所述SOFA对应于所述音频数据,所述SOFC对应于所述控制命令,M不大于N;将所述M个数据帧或M个控制帧通过单线输出接口输出。
优选地,所述第一预设比特长度为4比特,所述第二预设比特长度为5比特;所述将所述N个第一预设比特长度的二进制码流按照预设规则编码为N个第二预设比特长度的二进制码流,包括:将所述N个第一预设比特长度的二进制码流扩展成所述N个第二预设比特长度的二进制码流,其中,所述第二预设比特长度的二进制码流内包含1和0,并且所述第二预设比特长度的二进制码流内不包含连续的三个1,并且,若所述第二预设比特长度的二进制码流的第一位为1,则所述第二预设比特长度的二进制码流的第二位为0;若所述第二预设比特长度的二进制码流的最后一位为1,则所述第二预设比特长度的二进制码流的倒数第二位为0。
优选地,所述SOFA和所述SOFC均为第一比特位为0,且包含有连续的三个1的比特码流。
根据本发明的另一个方面,提供了一种信号的接收方法,包括:通过单线输入接口接收M个数据帧或M个控制帧,所述M个数据帧或所述M个控制帧的每一个包括至少一个第二预设比特长度的二进制码流,以及设置在所述第二预设比特长度的二进制码流的起始位置的数据帧起始标志SOFA或控制帧起始标志SOFC,其中,所述SOFA对应于所述数据帧,所述SOFC对应于所述控制帧;将所述M个数据帧或所述M个控制帧按照预设规则解码为N个第一预设比特长度的二进制码流,所述第二预设比特长度大于所述第一预设比特长度,N为大于0的整数,M不大于N。
优选地,所述SOFA和SOFC均为第一比特位为0,且包含有连续的三个1的比特码流。
优选地,所述第一预设比特长度为4比特,所述第二预设比特长度为5比特;所述将所述M个数据帧或所述M个控制帧按照预设规则解码为N个第一预设比特长度的二进制码流,包括:将所述M个数据帧或所述M个控制帧解码为所述N个第一预设比特长度的二进制码流,其中,所述第二预设比特长度的二进制码流内包含1和0,并且所述第二预设比特长度的二进制码流内不包含连续的三个1,并且若所述第二预设比特长度的二进制码流的第一位为1,则所述第二预设比特长度的二进制码流的第 二位为0,并且若所述第二预设比特长度的二进制码流的最后一位为1,则所述第二预设比特长度的二进制码流的倒数第二位为0。
根据本发明的另一方面,提供了一种发送装置,包括:数据分组单元,设置为将待发送的音频数据或用于对音频传输过程进行配置的控制命令划分为N个第一预设比特长度的二进制码流,N为大于0的整数;编码单元,设置为将所述N个第一预设比特长度的二进制码流按照预设规则编码为N个第二预设比特长度的二进制码流,所述第二预设比特长度大于所述第一预设比特长度;在至少一个所述第二预设比特长度的二进制码流的起始位置设置数据帧起始标志SOFA或控制帧起始标志SOFC,生成M个数据帧或M个控制帧,其中,所述SOFA对应于所述音频数据,所述SOFC对应于所述控制命令,M不大于N;输出单元,设置为将所述M个数据帧或M个控制帧通过单线输出接口输出。
优选地,所述编码单元,设置为将所述N个第一预设比特长度的二进制码流扩展成所述N个第二预设比特长度的二进制码流,其中,所述第二预设比特长度的二进制码流内包含1和0,并且所述第二预设比特长度的二进制码流内不包含连续的三个1,并且若所述第二预设比特长度的二进制码流的第一位为1,则所述第二预设比特长度的二进制码流的第二位为0,并且若所述第二预设比特长度的二进制码流的最后一位为1,则所述第二预设比特长度的二进制码流的倒数第二位为0;所述SOFA和所述SOFC均为第一比特位为0,且包含有连续的三个1的比特码流。
根据本发明的另一方面,提供了一种接收装置,包括:接收单元,设置为通过单线输入接口接收M个数据帧或M个控制帧,所述M个数据帧或所述M个控制帧的每一个包括至少一个第二预设比特长度的二进制码流,以及设置在所述第二预设比特长度的二进制码流的起始位置的数据帧起始标志SOFA或控制帧起始标志SOFC,其中,所述SOFA对应于所述数据帧,所述SOFC对应于所述控制帧,N为大于0的整数,M不大于N;解码单元,设置为将所述M个数据帧或所述M个控制帧按照预设规则解码为N个第一预设比特长度的二进制码流,所述第二预设比特长度大于所述第一预设比特长度。
优选地,所述解码单元,设置为将所述M个数据帧或所述M个控制帧解码为所述N个第一预设比特长度的二进制码流,其中,所述第二预设比特长度的二进制码流内包含1和0,并且所述第二预设比特长度的二进制码流内不包含连续的三个1,并且若所述第二预设比特长度的二进制码流的第一位为1,则所述第二预设比特长度的二进制码流的第二位为0,并且若所述第二预设比特长度的二进制码流的最后一位为1,则所述第二预设比特长度的二进制码流的倒数第二位为0。
根据本发明的另一个方面,提供了一种信号交互系统,包括:处理器,设置为将待发送的音频数据或用于对音频传输过程进行配置的控制命令划分为N个第一预设比特长度的二进制码流,N为大于0的整数;将所述N个第一预设比特长度的二进制码流按照预设规则编码为N个第二预设比特长度的二进制码流,所述第二预设比特长度大于所述第一预设比特长度;在至少一个所述第二预设比特长度的二进制码流的起始位置设置数据帧起始标志SOFA或控制帧起始标志SOFC,生成M个数据帧或M个控制帧,其中,所述SOFA对应于所述音频数据,所述SOFC对应于所述控制命令,M不大于N;将所述M个数据帧或M个控制帧通过单线输出接口传输至音频解码器;
所述音频解码器,设置为通过单线输入接口接收所述M个数据帧或所述M个控制帧;将所述M个数据帧或所述M个控制帧按照预设规则解码为所述N个第一预设比特长度的二进制码流。
通过本发明,采用将待发送的音频数据或者控制命令按照预设规则进行编码,并在编码后的二进制码流的起始位置设置数据帧起始标志或控制帧起始标志,进而通过单线输出接口进行传输的技术方案。解决了相关技术中音频数据和控制命令需要通过多根信号线传输的问题,进而达到了电路简化、设备小型化的效果。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本发明实施例的信号的发送方法流程示意图;
图2是根据本发明实施例的信号的接收方法流程示意图;
图3是根据本发明实施例的发送装置的结构示意图;
图4是根据本发明实施例的接收装置的结构示意图;
图5是根据本发明实施例的信号交互系统的结构示意图;
图6是根据本发明实施例的基本电路框图;
图7是根据本发明实施例的发送侧的硬件逻辑框图;
图8是根据本发明实施例的接收侧的硬件逻辑框图;
图9是根据本发明实施例的工作流程示意图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。
需要说明的是,本发明实施例中的“第一”“第二”仅用于区分,并不用于对顺序或优先级的限定。
本发明实施例提供了一种信号的发送方法,如图1所示,该方法包括以下步骤:
S102、将待发送的音频数据或用于对音频传输过程进行配置的控制命令划分为N个第一预设比特长度的二进制码流,N为大于0的整数;
S104、将N个第一预设比特长度的二进制码流按照预设规则编码为N个第二预设比特长度的二进制码流,第二预设比特长度大于第一预设比特长度;
S106、在至少一个第二预设比特长度的二进制码流的起始位置设置数据帧起始标志SOFA或控制帧起始标志SOFC,生成M个数据帧或M个控制帧,其中,SOFA对应于音频数据,SOFC对应于控制命令,M不大于N;
S108、将M个数据帧或M个控制帧通过单线输出接口输出。
其中,每一个第二预设比特长度的二进制码流中均不包含SOFA(START OF FRAME-AUDIO,数据帧起始标志)或SOFC(START OF FRAME-COMMAND,控制帧起始标志),即第二预设比特长度的二进制码流的编码方式与SOFA或SOFC不相同,进而保证了SOFA和SOFC的唯一性,方便使用简单的电路对SOFA和SOFC进行检测。其中,多个第二预设长度的比特码流可以对应一个SOFA或SOFC。
本发明实施例中,由于采用了将待发送的音频数据或者控制命令按照预设规则进行编码,并在编码后的二进制码流的起始位置设置数据帧起始标志或控制帧起始标志,从而实现通过单线输出接口进行传输的技术方案。因此,可以解决音频数据和控制命令需要通过多根信号线传输的问题,进而达到了电路简化、设备小型化的效果。
优选地,将N个第一预设比特长度的二进制码流按照预设规则编码为N个第二预设比特长度的二进制码流,包括:将N个第一预设比特长度的二进制码流扩展成N个第二预设比特长度的二进制码流,其中,第二预设比特长度的二进制码流内包含1和0,并且第二预设比特长度的二进制码流内不包含连续的三个1,并且若第二预设比特长度的二进制码流的第一位为1,则第二预设比特长度的二进制码流的第二位为0,并且若第二预设比特长度的二进制码流的最后一位为1,则第二预设比特长度的二进制码流的倒数第二位为0。根据这样的编码方案,无论按任意顺序随意组合,均不会出现连续的3个或更多的1。
优选地,SOFA和SOFC均为第一比特位为0,且包含有连续的三个1的比特码流。进而保证了SOFA和SOFC的唯一性,方便使用简单的电路对SOFA和SOFC进行检测。
优选地,将M个数据帧或M个控制帧通过单线输出接口传输至音频解码器包括:将M个数据帧或M个控制帧转换为串行帧,并将串行帧通过单线输出接口传输至音频解码器。进而按照预定的格式组成串行帧,在单根信号线上进行传输。
优选地,第一预设比特长度为4比特,第二预设比特长度为5比特。
本发明实施例还提供了一种信号的接收方法,如图2所示,该方法包括以下步骤:
S202、通过单线输入接口接收M个数据帧或M个控制帧,M个数据帧或M个控制帧的每一个包括至少一个第二预设比特长度的二进制码流,以及设置在第二预设比特长度的二进制码流的起始位置的数据帧起始标志SOFA或控制帧起始标志SOFC,其中,SOFA对应于数据帧,SOFC对应于控制帧;
S204、将M个数据帧或M个控制帧按照预设规则解码为N个第一预设比特长度的二进制码流,第二预设比特长度大于第一预设比特长度N为大于0的整数,M不大于N。
优选地,将M个数据帧或M个控制帧按照预设规则解码为N个第一预设比特长度的二进制码流,包括:将M个数据帧或M个控制帧解码为N个第一预设比特长度的二进制码流,其中,第二预设比特长度的二进制码流内包含1和0,并且第二预设比特长度的二进制码流内不包含连续的三个1,并且若第二预设比特长度的二进制码流的第一位为1,则第二预设比特长度的二进制码流的第二位为0,并且若第二预设比特长度的二进制码流的最后一位为1,则第二预设比特长度的二进制码流的倒数第二位为0。
优选地,SOFA和SOFC均为第一比特位为0,且包含有连续的三个1的比特码流。
优选地,第一预设比特长度为4比特,第二预设比特长度为5比特。
本发明实施例还提供了一种发送装置,如图3所示,该装置包括:
数据分组单元302,设置为将待发送的音频数据或用于对音频传输过程进行配置的控制命令划分为N个第一预设比特长度的二进制码流,N为大于0的整数;
编码单元304,设置为将N个第一预设比特长度的二进制码流按照预设规则编码为N个第二预设比特长度的二进制码流,第二预设比特长度大于第一预设比特长度;在至少一个第二预设比特长度的二进制码流的起始位置设置数据帧起始标志SOFA或控制帧起始标志SOFC,生成M个数据帧或M个控制帧,其中,SOFA对应于音频数据,SOFC对应于控制命令;
输出单元306,设置为将M个数据帧或M个控制帧通过单线输出接口传输至音频解码器。
优选地,编码单元304,设置为将N个第一预设比特长度的二进制码流扩展成N个第二预设比特长度的二进制码流,其中,第二预设比特长度的二进制码流内包含1和0,并且第二预设比特长度的二进制码流内不包含连续的三个1,并且若第二预设比特长度的二进制码流的第一位为1,则第二预设比特长度的二进制码流的第二位为0,并且若第二预设比特长度的二进制码流的最后一位为1,则第二预设比特长度的二进制码流的倒数第二位为0。
优选地,SOFA和SOFC均为第一比特位为0,且包含有连续的三个1的比特码流。
优选地,输出单元306,设置为将M个数据帧或M个控制帧通过单线输出接口串行输出。
本发明实施例还提供了一种接收装置,如图4所示,该装置包括:
接收单元402,设置为通过单线输入接口接收M个数据帧或M个控制帧,N为大于0的整数,M个数据帧或M个控制帧的每一个包括至少一个第二预设比特长度的二进制码流,以及设置在第二预设比特长度的二进制码流的起始位置的数据帧起始标志SOFA或控制帧起始标志SOFC,其中,SOFA对应于数据帧,SOFC对应于控制帧;
解码单元404,设置为将M个数据帧或M个控制帧按照预设规则解码为N个第一预设比特长度的二进制码流,第二预设比特长度大于第一预设比特长度。
优选地,解码单元404,设置为将M个数据帧或M个控制帧解码为N个第一预设比特长度的二进制码流,其中,第二预设比特长度的二进制码流内包含1和0,并且第二预设比特长度的二进制码流内不包含连续的三个1,并且若第二预设比特长度的二进制码流的第一位为1,则第二预设比特长度的二进制码流的第二位为0,并且若第二预设比特长度的二进制码流的最后一位为1,则第二预设比特长度的二进制码流的倒数第二位为0。
本发明实施例还提供了一种信号交互系统,如图5所示,该系统包括:
处理器502,设置为将待发送的音频数据或用于对音频传输过程进行配置的控制命令划分为N个第一预设比特长度的二进制码流,N为大于0的整数;将N个第一预设比特长度的二进制码流按照预设规则编码为N个第二预设比特长度的二进制码流,第二预设比特长度大于第一预设比特长度;在至少一个第二预设比特长度的二进制码流的起始位置设置数据帧起始标志SOFA或控制帧起始标志SOFC,生成M个数据帧或M个控制帧,其中,SOFA对应于音频数据,SOFC对应于控制命令;将M个数据帧或M个控制帧通过单线输出接口传输至音频解码器504;
音频解码器504,设置为通过单线输入接口接收M个数据帧或M个控制帧;将M个数据帧或M个控制帧按照预设规则解码为N个第一预设比特长度的二进制码流。
通过本发明,采用将待发送的音频数据或者控制命令按照预设规则进行编码,并在编码后的二进制码流的起始位置设置数据帧起始标志或控制帧起始标志,进而通过单线输出接口进行传输的技术方案。解决了相关技术中音频数据和控制命令需要通过多根信号线传输的问题,进而达到了电路简化、设备小型化的效果。
本发明提供一种新型的音频信号接口,能够使用单根信号线传输单方向的音频信号,支持多声道传输,位宽和采样率可变,而且可以将配置信息(相当于上述的控制命令)直接通过该信号线发送,无需单独的配置接口。该编码方式远比SPDIF简单,接口的逻辑电路和软件开销低,可广泛适用于设备内部的音频互连,替代原有的和PCM和I2S等音频信号线,并取消原有的I2C或SPI等控制信号线,大幅度简化电路。该接口采用以下的技术手段实现:
对于控制命令和音频数据,都按预定的格式组成串行的帧,在单根信号线上进行传输。
帧与帧之间,通过特定的帧起始标志(SOF,START OF FRAME)进行区分,该SOF是一串二进制码流,仅用于标志一个帧的开始,在帧内部的其他部分不出现。SOF 可以有多个(例如上述的SOFA和SOFB),用于将帧区分为不同的种类,例如可以将帧区分为音频帧和命令帧(相当于上述的控制帧)两类,分别用于传输音频数据和控制命令。
为了传递时钟信息,并避免音频数据和控制命令中出现SOF,需要选择合适的SOF,并且要对音频数据和控制命令在传输前进行编码。一种优选的编码方案是:首先,将音频数据和控制命令,划分为多个4比特长度的二进制组;其次,将此二进制组扩展为5比特,并且该5比特满足以下的三个条件:A)编码内必须包含1和0,B)不出现连续的3个1,C)位于首尾的连续1只能有1个;最后,使用包含连续3个1的5比特码流作为SOF。
编码后的数据,附带在SOF的后面,组成一帧,通过单极性不归零调制或其他基带调制方法,发送到单根信号线上进行传输。
接口信号线路上有默认的帧长、音频通道数和字宽。系统启动后,通信双方以默认的格式通信。在工作过程中,双方通过协商,可以更改帧长度,音频通道数和字宽。
基本电路框图如图6所示,整个系统由处理器系统HOST SYSTEM,音频解码器AUDIO CODEC,以及电声器件MIC(Microphone,麦克风)/SPEAKER(微型喇叭)组成。其中主处理器(相当于上述的处理器,以下简称为HOST)和AUDIO CODEC之间使用两根单向的音频信号线连接,其中一根线的传输方向是主处理器到AUDIO CODEC,作为主机对AUDIO CODEC的控制命令传输通道和音频数据传输通道,另一根线的传输方向是AUDIO CODEC(以下简称为CODEC)到主处理器,用于传输反向的控制命令和MIC/SPEAKER接收到环境声音。
本实施例中,将数字化的音频信号,每4比特进行一次扩展编码,将其扩展到5比特后进行传输,编码遵循以下的规则:
(1)每个编码内必须包含1和0,以确保携带时钟信息;
(2)所有编码内没有三个或更多连续的1;
(3)首尾连续的1最多只有1个,这样在连续发送多个编码是不会产生三个或更多连续的1;
根据这个原则确定的一个典型的编码方案如表1:
表1
Figure PCTCN2015074793-appb-000001
根据这样的编码方案,编码后的5比特,无论按任何顺序随意组合,均不会出现连续的3个或更多的1。根据这个规律,本实施例规定用包含3个连续1的比特流01110(即十六进制的0EH)、01111(即十六进制的0FH)和00111(即十六进制的07H)作为SOF。这两个比特流均以0起始,并且内部均包含连续的3个1,保证了起始帧的唯一性,方便使用简单的电路对SOF进行检测。
帧分为两种,一种是控制帧,内部包含控制命令,一种是音频帧,内部包含音频数据。本实施例中,规定用0EH作为SOF引导的帧是音频帧,用0FH作为SOF引导的帧是控制帧。对应的,将0EH称为音频帧标志(SOFA),将0FH称为命令帧标志(SOFC)。在本实施例中,默认帧长度是25比特,使用200kbps的物理层通信速率。具体帧格式如表2和表3所示:
表2音频帧格式
…· SOFA 左声道10比特 右声道10比特 …·
……· 01110 XXXXXXXXXX YYYYYYYYYY ………
表3命令帧格式
…·· SOFC 命令字20比特 …··
……· 01111 ZZZZZZZZZZZZZZZZZZZZ …………
需要说明的是,帧内的音频码流,是先经过编码扩展后才组帧的,左右声道虽然看上去是10比特,但只携带有8比特的有效信息。命令字也是按照上述方法编码后才发送到信号线上去的,命令字在编码前是16比特,编码后在帧内变为20比特。
因为每一帧的固定长度是25比特,根据200kbps的速率,每帧的数据发送占据125us的时间,在无间隔连续发送时,对应的帧频是8kHz。即默认的音频信号,是双声道,8比特量化,8kHz的采样率。
命令帧的有效位宽是16比特,在本实施例中,具体的命令示例如表4,表4中未出现的命令保留不用。
表4
Figure PCTCN2015074793-appb-000002
本实施例中,发送侧的硬件逻辑框图如图7所示。首先,音频数据和控制命令进入二选一开关,根据需要选中一路。被选中的数据被再被划分为4比特的组(数据分组),随后进入编码器,将每4比特编码扩展为5比特。
上述5比特宽度的数据再次进入一个二选一开关,此开关可以在上述编码后的5比特数据和SOFA/SOFC之间,根据需要选择其中一个,并通过时钟单元控制的5bit移位寄存器输出到信号线上。当需要传输0时,输出逻辑低电平,需要传输1时,输出逻辑高电平。
本实施例中,接收侧的硬件逻辑框图如图8所示。时钟单元利用输入信号的高低电平跳变,提取时钟的相位信息。接收时钟驱动5bit移位寄存器,产生5比特宽度的二进制数据。
SOF检测单元对5bit移位寄存器的5比特进行连续检测,一旦检测到SOFA或者SOFC,则输出SOF/SOFA/SOFC信号。在SOF/SOFA/SOFC信号的控制下,解码单元和数据合并单元对5比特宽的数据先进行解码变为4比特,再合并为所需的并行数据。
SOFA和SOFC信号,还分别控制命令输入寄存器和音频缓冲区,将合并后的数据送出到命令寄存器或音频缓冲区。
下面,以一个完整的工作流程为例,对本实施例的工作原理进行更具体地说明。这个工作流程如图9所示,主机和CODEC(音频解码器)上电后,以200kbps的默认速率通信。主机首先将通信格式切换为双声道/8kHz/16bit位宽,然后将CODEC的音量设置为最大值,最后输出一个双声道的4kHz方波信号(交替的0x5050和0Xb050)给CODEC播放。详细步骤如下:
1)系统加电后,默认的速率是200kbps,但双向信号线均空闲,恒定为低电平,双方接收到的是全0信号,双方都检测不到SOF,如表5及表6:
表5 输出帧格式
………· IDLE IDLE IDLE IDLE IDLE IDLE ……··
………· 00000 00000 00000 00000 00000 00000 ………
  00H 00H 00H 00H 00H 00H  
表6 输入帧格式
………· IDLE IDLE IDLE IDLE IDLE IDLE ……··
………· 00000 00000 00000 00000 00000 00000 ………
  00H 00H 00H 00H 00H 00H  
2)复位后软件开始工作,通过单线接口向音频解码器发送一帧控制命令,查询音频解码器是否支持所需的格式。帧的最前面是起始标志(SOFC),在命令标志后面跟随CODEC查询命令0112H,询问CODEC是否能支持双声道/8kHz/16bit的格式。此时同时,音频输入信号线(从CODEC到HOST方向),仍旧保持IDLE状态,如表7及表8:
表7 输出帧格式
Figure PCTCN2015074793-appb-000003
表8 输入帧格式
………· IDLE IDLE IDLE IDLE IDLE IDLE ……··
………· 00000 00000 00000 00000 00000 00000 ………
  00H 00H 00H 00H 00H 00H  
3)随后,CODEC发送出应答命令0212H,给主机答复可以支持2声道/8kHz/16bit的数据格式。此时,HOST输出IDLE状态,如表9及表10:
表9 输出帧格式
………· IDLE IDLE IDLE IDLE IDLE IDLE ……··
………· 00000 00000 00000 00000 00000 00000 ………
  00H 00H 00H 00H 00H 00H  
表10 输入帧格式
Figure PCTCN2015074793-appb-000004
4)主机收到CODEC的应答命令后,知道CODEC支持双声道/8kHz/16bit的格式。于是给音频解码器发送设置命令0312H,设置新的通信模式。
表11 输出帧格式
Figure PCTCN2015074793-appb-000005
表12 输入帧格式
……… IDLE IDLE IDLE IDLE IDLE IDLE ……··
……… 00000 00000 00000 00000 00000 00000 ………
  00H 00H 00H 00H 00H 00H  
5),在主机发出上述命令后,立即将输出的帧格式切换为,如表13及表14:
表13 音频帧格式
……· 帧起始 左声道20比特 右声道20比特 ……·
  01110 XXXXXXXX YYYYYYYY  
表14 命令帧格式
  帧起始 命令字20比特 空闲20比特 …··
…·· 01111 ZZZZZZZZ ………·
由于新的帧长是45比特,帧速率不变仍旧是8k,物理层的通信速率变更为45*8k=360kbps。
CODEC在接收到通信格式更新命令后,也立即将接收电路配置到上述的帧格式和通信速率上。
6)主机用新的帧格式向音频解码器发配置命令,将音量设置到最大,对应的设置命令是047FH。因为新的帧长已经变长,命令没有占用的长度,输出IDLE。此时,音频输入信号线,仍旧保持IDLE状态,如表15及表16:
表15 输出帧格式
Figure PCTCN2015074793-appb-000006
表16 输入帧格式
………· IDLE IDLE IDLE IDLE IDLE IDLE ……··
………· 00000 00000 00000 00000 00000 00000 ………
  00H 00H 00H 00H 00H 00H  
7)在CODEC接收到并正确解码音量设置命令后,将自身的音量输出设置为最大,并且向HOST发出应答信息04FFH,此时HOST处于等待状态,输出信号保持空闲状态,如表17及表18:
表17 输出帧格式
…… IDLE IDLE IDLE IDLE IDLE IDLE ……··
…… 00000 00000 00000 00000 00000 00000 ………
  00H 00H 00H 00H 00H 00H  
表18 输入帧格式
Figure PCTCN2015074793-appb-000007
8)在HOST接收到来自于CODEC的应答信息后,开始向音频解码器发送音频数据,此时音频输入信号线处于空闲状态。HOST输出的音频数据是循环的5050H和A050H,每个数据发送两次,分别表示左声道和右声道,如表19及表20:
表19 输出帧格式
Figure PCTCN2015074793-appb-000008
表20 输入帧格式
………· IDLE IDLE IDLE IDLE IDLE IDLE ……··
………· 00000 00000 00000 00000 00000 00000 ………
9)CODEC收到上述循环的5050H和A050H后,经过ADC(Analog-to-Digital Converter,模/数转换器)和功放,将此方波输出给SPEAKER,发出告警声。
在另外一个实施例中,还提供了一种软件,该软件用于执行上述实施例及优选实施方式中描述的技术方案。
在另外一个实施例中,还提供了一种存储介质,该存储介质中存储有上述软件,该存储介质包括但不限于:光盘、软盘、硬盘、可擦写存储器等。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
工业实用性
如上所述,通过上述实施例及优选实施方式,解决了相关技术中音频数据和控制命令需要通过多根信号线传输的问题,进而达到了电路简化、设备小型化的效果。

Claims (11)

  1. 一种信号的发送方法,包括:
    将待发送的音频数据或用于对音频传输过程进行配置的控制命令划分为N个第一预设比特长度的二进制码流,N为大于0的整数;
    将所述N个第一预设比特长度的二进制码流按照预设规则编码为N个第二预设比特长度的二进制码流,所述第二预设比特长度大于所述第一预设比特长度;
    在至少一个所述第二预设比特长度的二进制码流的起始位置设置数据帧起始标志SOFA或控制帧起始标志SOFC,生成M个数据帧或M个控制帧,其中,所述SOFA对应于所述音频数据,所述SOFC对应于所述控制命令,M不大于N;
    将所述M个数据帧或M个控制帧通过单线输出接口输出。
  2. 根据权利要求1所述的信号的发送方法,其中,所述第一预设比特长度为4比特,所述第二预设比特长度为5比特;所述将所述N个第一预设比特长度的二进制码流按照预设规则编码为N个第二预设比特长度的二进制码流,包括:
    将所述N个第一预设比特长度的二进制码流扩展成所述N个第二预设比特长度的二进制码流,其中,所述第二预设比特长度的二进制码流内包含1和0,所述第二预设比特长度的二进制码流内不包含连续的三个1,并且,若所述第二预设比特长度的二进制码流的第一位为1,则所述第二预设比特长度的二进制码流的第二位为0;若所述第二预设比特长度的二进制码流的最后一位为1,则所述第二预设比特长度的二进制码流的倒数第二位为0。
  3. 根据权利要求2所述的信号的发送方法,其中,所述SOFA和所述SOFC均为第一比特位为0,且包含有连续的三个1的比特码流。
  4. 一种信号的接收方法,包括:
    通过单线输入接口接收M个数据帧或M个控制帧,所述M个数据帧或所述M个控制帧的每一个包括至少一个第二预设比特长度的二进制码流,以及设置在所述第二预设比特长度的二进制码流的起始位置的数据帧起始标志SOFA或控制帧起始标志SOFC,其中,所述SOFA对应于所述数据帧,所述SOFC对应于所述控制帧;
    将所述M个数据帧或所述M个控制帧按照预设规则解码为N个第一预设比特长度的二进制码流,所述第二预设比特长度大于所述第一预设比特长度,N为大于0的整数,M不大于N。
  5. 根据权利要求4所述的信号的接收方法,其中,所述SOFA和SOFC均为第一比特位为0,且包含有连续的三个1的比特码流。
  6. 根据权利要求5所述的信号的接收方法,其中,所述第一预设比特长度为4比特,所述第二预设比特长度为5比特;所述将所述M个数据帧或所述M个控制帧按照预设规则解码为N个第一预设比特长度的二进制码流,包括:
    将所述M个数据帧或所述M个控制帧解码为所述N个第一预设比特长度的二进制码流,其中,所述第二预设比特长度的二进制码流内包含1和0,并且所述第二预设比特长度的二进制码流内不包含连续的三个1,并且若所述第二预设比特长度的二进制码流的第一位为1,则所述第二预设比特长度的二进制码流的第二位为0,并且若所述第二预设比特长度的二进制码流的最后一位为1,则所述第二预设比特长度的二进制码流的倒数第二位为0。
  7. 一种发送装置,包括:
    数据分组单元,设置为将待发送的音频数据或用于对音频传输过程进行配置的控制命令划分为N个第一预设比特长度的二进制码流,N为大于0的整数;
    编码单元,设置为将所述N个第一预设比特长度的二进制码流按照预设规则编码为N个第二预设比特长度的二进制码流,所述第二预设比特长度大于所述第一预设比特长度;在至少一个所述第二预设比特长度的二进制码流的起始位置设置数据帧起始标志SOFA或控制帧起始标志SOFC,生成M个数据帧或M个控制帧,其中,所述SOFA对应于所述音频数据,所述SOFC对应于所述控制命令,M不大于N;
    输出单元,设置为将所述M个数据帧或M个控制帧通过单线输出接口输出。
  8. 根据权利要求7所述的发送装置,其中,
    所述编码单元,设置为将所述N个第一预设比特长度的二进制码流扩展成所述N个第二预设比特长度的二进制码流,其中,所述第二预设比特长度的二进制码流内包含1和0,并且所述第二预设比特长度的二进制码流内不包含连续的三个1,并且若所述第二预设比特长度的二进制码流的第一位为1,则所述 第二预设比特长度的二进制码流的第二位为0,并且若所述第二预设比特长度的二进制码流的最后一位为1,则所述第二预设比特长度的二进制码流的倒数第二位为0;所述SOFA和所述SOFC均为第一比特位为0,且包含有连续的三个1的比特码流。
  9. 一种接收装置,包括:
    接收单元,设置为通过单线输入接口接收M个数据帧或M个控制帧,所述M个数据帧或所述M个控制帧的每一个包括至少一个第二预设比特长度的二进制码流,以及设置在所述第二预设比特长度的二进制码流的起始位置的数据帧起始标志SOFA或控制帧起始标志SOFC,其中,所述SOFA对应于所述数据帧,所述SOFC对应于所述控制帧,N为大于0的整数,M不大于N;
    解码单元,设置为将所述M个数据帧或所述M个控制帧按照预设规则解码为N个第一预设比特长度的二进制码流,所述第二预设比特长度大于所述第一预设比特长度。
  10. 根据权利要求9所述的接收装置,其中,
    所述解码单元,设置为将所述M个数据帧或所述M个控制帧解码为所述N个第一预设比特长度的二进制码流,其中,所述第二预设比特长度的二进制码流内包含1和0,并且所述第二预设比特长度的二进制码流内不包含连续的三个1,并且若所述第二预设比特长度的二进制码流的第一位为1,则所述第二预设比特长度的二进制码流的第二位为0,并且若所述第二预设比特长度的二进制码流的最后一位为1,则所述第二预设比特长度的二进制码流的倒数第二位为0。
  11. 一种信号交互系统,包括:
    处理器,设置为将待发送的音频数据或用于对音频传输过程进行配置的控制命令划分为N个第一预设比特长度的二进制码流,N为大于0的整数;将所述N个第一预设比特长度的二进制码流按照预设规则编码为N个第二预设比特长度的二进制码流,所述第二预设比特长度大于所述第一预设比特长度;在至少一个所述第二预设比特长度的二进制码流的起始位置设置数据帧起始标志SOFA或控制帧起始标志SOFC,生成M个数据帧或M个控制帧,其中,所述SOFA对应于所述音频数据,所述SOFC对应于所述控制命令,M不大于N;将所述M个数据帧或M个控制帧通过单线输出接口传输至音频解码器;
    所述音频解码器,设置为通过单线输入接口接收所述M个数据帧或所述M个控制帧;将所述M个数据帧或所述M个控制帧按照预设规则解码为所述N个第一预设比特长度的二进制码流。
PCT/CN2015/074793 2014-11-18 2015-03-20 信号的发送、接收方法及装置、系统 WO2016078271A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410660404.3A CN105681819B (zh) 2014-11-18 2014-11-18 信号的发送、接收方法及装置、系统
CN201410660404.3 2014-11-18

Publications (1)

Publication Number Publication Date
WO2016078271A1 true WO2016078271A1 (zh) 2016-05-26

Family

ID=56013168

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/074793 WO2016078271A1 (zh) 2014-11-18 2015-03-20 信号的发送、接收方法及装置、系统

Country Status (2)

Country Link
CN (1) CN105681819B (zh)
WO (1) WO2016078271A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110086549B (zh) * 2019-04-02 2021-09-14 北京小米移动软件有限公司 音频数据传输方法及装置
CN110312146B (zh) * 2019-06-06 2021-11-09 百度在线网络技术(北京)有限公司 音频处理方法、装置、电子设备和存储介质
CN113539280A (zh) * 2020-04-16 2021-10-22 华为技术有限公司 控制信号的发送方法、接收方法及相关设备
CN113204507A (zh) * 2021-04-25 2021-08-03 山东英信计算机技术有限公司 一种通用输入输出数据传输方法、装置、设备及介质
CN115243238A (zh) * 2022-06-30 2022-10-25 哲库科技(上海)有限公司 传输音频数据的装置、方法以及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1344409A (zh) * 1999-02-19 2002-04-10 默里迪恩音频有限公司 数据编码/解码装置和使用数据编码/解码装置的设备
JP2003152898A (ja) * 2001-11-12 2003-05-23 Nec Eng Ltd 電話端末装置
CN101272500A (zh) * 2008-05-14 2008-09-24 中兴通讯股份有限公司 一种视音频数据流的传输方法及系统
CN101764672A (zh) * 2009-07-24 2010-06-30 美的集团有限公司 一种应用于电磁炉数据通信的校验系统及其应用方法
CN103379397A (zh) * 2012-04-26 2013-10-30 国民技术股份有限公司 数据传输、处理、基于音频接口的信号处理方法及模块
CN103402007A (zh) * 2013-07-26 2013-11-20 广州史达泊雷网络科技有限公司 基于音频接口的智能终端与操控手柄之间的数据传输方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5644568A (en) * 1995-03-15 1997-07-01 Motorola, Inc. Method and apparatus for organizing and recovering information communicated in a radio communication system
FI118914B (fi) * 2006-05-02 2008-04-30 Ant Advanced Network Technolog Menetelmä ja järjestelmä langatonta tosiaikaista monikanavaisen audio- tai videodatan siirtoa varten
CN101557509B (zh) * 2008-04-07 2011-02-16 清华大学 兼容地面数字电视传输标准的移动多媒体传输方法
JP2009290783A (ja) * 2008-05-30 2009-12-10 Canon Inc 通信システム、通信システムの制御方法、プログラム及び記憶媒体

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1344409A (zh) * 1999-02-19 2002-04-10 默里迪恩音频有限公司 数据编码/解码装置和使用数据编码/解码装置的设备
JP2003152898A (ja) * 2001-11-12 2003-05-23 Nec Eng Ltd 電話端末装置
CN101272500A (zh) * 2008-05-14 2008-09-24 中兴通讯股份有限公司 一种视音频数据流的传输方法及系统
CN101764672A (zh) * 2009-07-24 2010-06-30 美的集团有限公司 一种应用于电磁炉数据通信的校验系统及其应用方法
CN103379397A (zh) * 2012-04-26 2013-10-30 国民技术股份有限公司 数据传输、处理、基于音频接口的信号处理方法及模块
CN103402007A (zh) * 2013-07-26 2013-11-20 广州史达泊雷网络科技有限公司 基于音频接口的智能终端与操控手柄之间的数据传输方法

Also Published As

Publication number Publication date
CN105681819A (zh) 2016-06-15
CN105681819B (zh) 2020-01-07

Similar Documents

Publication Publication Date Title
WO2016078271A1 (zh) 信号的发送、接收方法及装置、系统
US10667056B2 (en) Low power synchronous data interface
KR102569374B1 (ko) 블루투스 장치 동작 방법
JP2006246462A (ja) マルチドロップイーサネット
US20180152779A1 (en) Low latency transmission systems and methods for long distances in soundwire systems
CN108885880A (zh) 用于处置音频流中的静默的系统和方法
CN107277691B (zh) 基于云的多声道音频播放方法、系统及音频网关装置
CN105027104A (zh) 用于多分支数字总线的方法和装置
AU2018214678B2 (en) A/V interconnection architecture including an audio down-mixing transmitter A/V endpoint and distributed channel amplification
CN104301802A (zh) 用于流式传输音频或视频数据的数字装置、网络和方法
US10305670B2 (en) Digital accessory interface
CN110085241A (zh) 数据编码方法、装置、计算机存储介质及数据编码设备
CN103209269A (zh) 一种基于Zigbee技术的数字无线多通道语音会议方法及装置
WO2014194752A1 (zh) 一种数据映射方法、装置及电子设备
TWI624174B (zh) 音頻-視頻資料的發送方法、接收方法和音頻-視頻資料的傳輸系統
WO2024007974A1 (zh) 一种时钟同步的方法和电子设备
KR20080086907A (ko) 데이터 전송 방법 및 전자 디바이스
CN205595068U (zh) 无线数字语音基带传输系统
KR101418880B1 (ko) 무선 인터폰 시스템
CN112218205B (zh) 一种基于inic的环形网络音频系统
CN107346662B (zh) 无线数字语音基带传输系统及其方法
CN207743985U (zh) 一种视频会议用协议转换器
Jhamb et al. Pulse Coded Modulation: A Novel Implementation for Enhanced Signal-to-Quantization Noise Ratio
CN116669004A (zh) 音频传输方法、装置、设备、系统及存储介质
Jhamb et al. A high performance real-time pulse coded modulation system using handshaking

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15861247

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15861247

Country of ref document: EP

Kind code of ref document: A1