CN105681819B - Method, device and system for transmitting and receiving signals - Google Patents

Method, device and system for transmitting and receiving signals Download PDF

Info

Publication number
CN105681819B
CN105681819B CN201410660404.3A CN201410660404A CN105681819B CN 105681819 B CN105681819 B CN 105681819B CN 201410660404 A CN201410660404 A CN 201410660404A CN 105681819 B CN105681819 B CN 105681819B
Authority
CN
China
Prior art keywords
bit length
binary code
preset bit
preset
code stream
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201410660404.3A
Other languages
Chinese (zh)
Other versions
CN105681819A (en
Inventor
韩正渭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201410660404.3A priority Critical patent/CN105681819B/en
Priority to PCT/CN2015/074793 priority patent/WO2016078271A1/en
Publication of CN105681819A publication Critical patent/CN105681819A/en
Application granted granted Critical
Publication of CN105681819B publication Critical patent/CN105681819B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

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

The invention discloses a method, a device and a system for sending and receiving signals, wherein the sending method comprises the following steps: dividing audio data to be transmitted or a control command for configuring an audio transmission process into N binary code streams with first preset bit lengths, wherein N is an integer greater than 0; coding the N binary code streams with the first preset bit length into N binary code streams with the second preset bit length according to a preset rule, wherein the second preset bit length is larger than the first preset bit length; setting a data frame start flag SOFA or a control frame start flag SOFC at the start position of at least one binary code stream with a second preset bit length 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; and outputting the M data frames or the M control frames through the single-wire output interface. The invention solves the problem that audio data and control commands need to be transmitted through a plurality of signal lines.

Description

Method, device and system for transmitting and receiving signals
Technical Field
The present invention relates to the field of communications, and in particular, to a method, an apparatus, and a system for transmitting and receiving a signal.
Background
With the development of technology, audio signals are transmitted between devices and inside devices, and a digitization method is increasingly used to avoid noise and distortion introduced by analog signal transmission. Common Digital audio formats include PCM (pulse code Modulation), I2S (Inter-IC Sound, Inter-chip audio Interface), SPDIF (Sony/Philips Digital Interface Format), and the like.
PCM and I2S are well established technologies, simple and reliable, and are used in large numbers for audio interconnections within devices. However, these two interfaces have common drawbacks: the first is that the unidirectional audio needs 3 signal lines for transmission, and the bidirectional audio needs 4 signal lines for transmission, which is slightly tedious; secondly, the interfaces on both sides must perform clock, bit width and time slot configuration before they can work normally, and these configuration commands must be implemented through other control interfaces such as I2C (Inter-Integrated Circuit) or SPI (Serial Peripheral Interface), which inevitably results in further increase of the number of wires, and is not favorable for simplification and low-cost design of the Circuit, and also for miniaturization of the device.
SPDIF is also a well-established technology that requires only a single signal line for transmitting unidirectional audio signals, and is very advantageous for simplifying the interconnection between audio devices. However, SPDIF also has significant drawbacks: firstly, the SPDIF protocol is relatively complex, which results in high circuit and software costs of both communication parties; secondly, the SPDIF does not support direct transmission of signals with more than 2 channels, and can be indirectly realized only by complex compression coding, thereby further increasing software overhead, increasing processor load and increasing power consumption. For the reasons mentioned above, SPDIF is currently only used for the interconnection between devices, such as the interconnection between independent players and independent power amplifiers, and is not generally used for the interconnection inside the devices.
Disclosure of Invention
The invention provides a method, a device and a system for sending and receiving signals, which at least solve the problem that audio data and control commands need to be transmitted through a plurality of signal lines in the related technology.
According to an aspect of the present invention, there is provided a signal transmission method, including: dividing audio data to be transmitted or a control command for configuring an audio transmission process into N binary code streams with first preset bit lengths, wherein N is an integer greater than 0; coding the N binary code streams with the first preset bit length into N binary code streams with second preset bit length according to a preset rule, wherein the second preset bit length is larger than the first preset bit length; setting a data frame start flag SOFA or a control frame start flag SOFC at the start position of at least one binary code stream with the second preset bit length, and generating M data frames or M control frames, wherein the SOFA corresponds to the audio data, the SOFC corresponds to the control command, and M is not more than N; and outputting the M data frames or the M control frames through a single-wire output interface.
Preferably, the first preset bit length is 4 bits, and the second preset bit length is 5 bits; the encoding the N binary code streams with the first preset bit length into N binary code streams with the second preset bit length according to a preset rule includes: expanding the N first binary code streams with a first preset bit length into N second binary code streams with a second preset bit length, wherein the second binary code streams with the second preset bit length include 1 and 0, the second binary code streams with the second preset bit length do not include three consecutive 1, and if the first bit of the second binary code stream with the second preset bit length is 1, the second bit of the second binary code stream with the second preset bit length is 0; and if the last bit of the binary code stream with the second preset bit length is 1, the second last bit of the binary code stream with the second preset bit length is 0.
Preferably, the SOFA and the SOFC have a first bit of 0 and include three consecutive bit streams of 1.
According to another aspect of the present invention, there is provided a signal receiving method including: receiving M data frames or M control frames through a single-wire input interface, wherein each of the M data frames or the M control frames comprises at least one binary code stream with a second preset bit length and a data frame start flag SOFA or a control frame start flag SOFC which is arranged at the start position of the binary code stream with the second preset bit length, wherein the SOFA corresponds to the data frame and the SOFC corresponds to the control frame; and decoding the M data frames or the M control frames into N binary code streams with first preset bit lengths according to a preset rule, wherein 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.
Preferably, both the SOFA and the SOFC have a first bit of 0 and include three consecutive bit streams of 1.
Preferably, the first preset bit length is 4 bits, and the second preset bit length is 5 bits; the decoding the M data frames or the M control frames into N binary code streams with a first preset bit length according to a preset rule includes: decoding the M data frames or the M control frames into the N first binary code streams with the first preset bit length, wherein the second binary code stream with the second preset bit length includes 1 and 0, and the second binary code stream with the second preset bit length does not include three consecutive 1 s, and if the first bit of the second binary code stream with the second preset bit length is 1, the second bit of the second binary code stream with the second preset bit length is 0, and if the last bit of the second binary code stream with the second preset bit length is 1, the second last bit of the second binary code stream with the second preset bit length is 0.
According to another aspect of the present invention, there is provided a transmission apparatus including: the data grouping unit is used for dividing audio data to be sent or a control command for configuring an audio transmission process into N binary code streams with first preset bit lengths, wherein N is an integer greater than 0; the encoding unit is used for encoding the N binary code streams with the first preset bit length into N binary code streams with second preset bit length according to a preset rule, wherein the second preset bit length is larger than the first preset bit length; setting a data frame start flag SOFA or a control frame start flag SOFC at the start position of at least one binary code stream with the second preset bit length, and generating M data frames or M control frames, wherein the SOFA corresponds to the audio data, the SOFC corresponds to the control command, and M is not more than N; and the output unit is used for outputting the M data frames or the M control frames through a single-wire output interface.
Preferably, the encoding unit is configured to expand the N first binary code streams with a preset bit length into the N second binary code streams with a preset bit length, where the second binary code stream with a preset bit length includes 1 and 0, and the second binary code stream with a preset bit length does not include three consecutive 1 s, and if the first bit of the second binary code stream with a preset bit length is 1, the second bit of the second binary code stream with a preset bit length is 0, and if the last bit of the second binary code stream with a preset bit length is 1, the second last bit of the second binary code stream with a preset bit length is 0; the SOFA and the SOFC both have a first bit of 0 and comprise three continuous bit code streams of 1.
According to another aspect of the present invention, there is provided a receiving apparatus including: a receiving unit, configured to receive M data frames or M control frames through a single-wire input interface, where each of the M data frames or the M control frames includes at least one binary code stream with a second preset bit length and a data frame start flag SOFA or a control frame start flag SOFC that is set at a start position of the binary code stream with the second preset bit length, where 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; a decoding unit, configured to decode the M data frames or the M control frames into N binary code streams with first preset bit lengths according to a preset rule, where the second preset bit length is greater than the first preset bit length.
Preferably, the decoding unit is configured to decode the M data frames or the M control frames into the N first binary code streams with the first preset bit length, where the second binary code stream with the second preset bit length includes 1 s and 0 s, and the second binary code stream with the second preset bit length does not include three consecutive 1 s, and if the first bit of the second binary code stream with the second preset bit length is 1, the second bit of the second binary code stream with the second preset bit length is 0, and if the last bit of the second binary code stream with the second preset bit length is 1, the second last bit of the second binary code stream with the second preset bit length is 0.
According to another aspect of the present invention, there is provided a signal interaction system including: the processor is used for dividing audio data to be transmitted or a control command for configuring an audio transmission process into N binary code streams with first preset bit lengths, wherein N is an integer greater than 0; coding the N binary code streams with the first preset bit length into N binary code streams with second preset bit length according to a preset rule, wherein the second preset bit length is larger than the first preset bit length; setting a data frame start flag SOFA or a control frame start flag SOFC at the start position of at least one binary code stream with the second preset bit length, and generating M data frames or M control frames, wherein the SOFA corresponds to the audio data, the SOFC corresponds to the control command, and M is not more than N; transmitting the M data frames or the M control frames to an audio decoder through a single-wire output interface;
the audio decoder is used for receiving the M data frames or the M control frames through a single-wire input interface; and decoding the M data frames or the M control frames into the N binary code streams with the first preset bit length according to a preset rule.
According to the invention, the technical scheme that the audio data or the control command to be sent is coded according to the preset rule, and the data frame starting mark or the control frame starting mark is set at the starting position of the coded binary code stream, so that the transmission is carried out through the single-wire output interface is adopted. The problem that audio data and control commands need to be transmitted through a plurality of signal lines in the related art is solved, and the effects of circuit simplification and equipment miniaturization are achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a flow chart illustrating a signal transmission method according to an embodiment of the present invention;
fig. 2 is a flow chart of a signal receiving method 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;
FIG. 6 is a basic circuit block diagram according to an embodiment of the invention;
FIG. 7 is a hardware logic block diagram of a transmit side according to an embodiment of the present invention;
FIG. 8 is a hardware logic block diagram of a receive side according to an embodiment of the invention;
fig. 9 is a schematic workflow diagram according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
It should be noted that "first" and "second" in the embodiments of the present invention are used for distinction only and are not used to limit the order or priority.
An embodiment of the present invention provides a signal sending method, as shown in fig. 1, the method includes the following steps:
s102, dividing audio data to be transmitted or a control command for configuring an audio transmission process into N binary code streams with first preset bit lengths, wherein N is an integer greater than 0;
s104, coding the N binary code streams with the first preset bit length into N binary code streams with the second preset bit length according to a preset rule, wherein the second preset bit length is larger than the first preset bit length;
s106, setting a data frame start mark SOFA or a control frame start mark SOFC at the start position of at least one binary code stream with a second preset bit length, and generating M data frames or M control frames, wherein the SOFA corresponds to audio data, the SOFC corresponds to a control command, and M is not more than N;
and S108, outputting the M data frames or the M control frames through the single-wire output interface.
Each binary code stream with the second preset bit length does not contain SOFA (START OF FRAME-AUDIO, data FRAME START mark) or SOFC (START OF FRAME-COMMAND, control FRAME START mark), that is, the coding mode OF the binary code stream with the second preset bit length is different from that OF the SOFA or SOFC, so that the uniqueness OF the SOFA and SOFC is ensured, and the SOFA and SOFC can be detected conveniently by using a simple circuit. The plurality of bit streams with the second preset length may correspond to one SOFA or SOFC.
In the embodiment of the invention, the technical scheme that the audio data or the control command to be sent is coded according to the preset rule, and the data frame starting mark or the control frame starting mark is set at the starting position of the coded binary code stream is adopted, so that the transmission is realized through the single-wire output interface. Therefore, the problem that audio data and control commands need to be transmitted through a plurality of signal lines can be solved, and the effects of circuit simplification and equipment miniaturization are achieved.
Preferably, the encoding N binary code streams with a first preset bit length into N binary code streams with a second preset bit length according to a preset rule includes: expanding the N binary code streams with the first preset bit length into N binary code streams with the second preset bit length, wherein the binary code streams with the second preset bit length include 1 and 0, the binary code streams with the second preset bit length do not include three consecutive 1 s, if the first bit of the binary code stream with the second preset bit length is 1, the second bit of the binary code stream with the second preset bit length is 0, and if the last bit of the binary code stream with the second preset bit length is 1, the second last bit of the binary code stream with the second preset bit length is 0. According to such a coding scheme, consecutive 3 or more 1 s do not occur, regardless of arbitrary combination in an arbitrary order.
Preferably, both SOFAs and SOFCs have a first bit of 0 and include three consecutive bit streams of 1. And the uniqueness of the SOFA and the SOFC is further ensured, and the SOFA and the SOFC can be conveniently detected by using a simple circuit.
Preferably, transmitting the M data frames or the M control frames to the audio decoder through the single-wire output interface includes: and converting the M data frames or the M control frames into serial frames, and transmitting the serial frames to an audio decoder through a single-wire output interface. And then the serial frames are formed according to a preset format and transmitted on a single signal wire.
Preferably, the first preset bit length is 4 bits, and the second preset bit length is 5 bits.
An embodiment of the present invention further provides a signal receiving method, as shown in fig. 2, the method includes the following steps:
s202, receiving M data frames or M control frames through a single-wire input interface, wherein each of the M data frames or the M control frames comprises at least one binary code stream with a second preset bit length and a data frame start mark SOFA or a control frame start mark SOFC arranged at the start position of the binary code stream with the second preset bit length, wherein the SOFA corresponds to the data frames, and the SOFC corresponds to the control frames;
s204, decoding the M data frames or the M control frames into N binary code streams with first preset bit lengths according to a preset rule, wherein the second preset bit length is larger than the first preset bit length, N is an integer larger than 0, and M is not larger than N.
Preferably, decoding the M data frames or the M control frames into N binary code streams of a first preset bit length according to a preset rule includes: decoding the M data frames or the M control frames into N binary code streams of a first preset bit length, wherein the binary code stream of a second preset bit length includes 1 and 0, and the binary code stream of the second preset bit length does not include three consecutive 1 s, and if the first bit of the binary code stream of the second preset bit length is 1, 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 1, the second last bit of the binary code stream of the second preset bit length is 0.
Preferably, both SOFAs and SOFCs have a first bit of 0 and include three consecutive bit streams of 1.
Preferably, the first preset bit length is 4 bits, and the second preset bit length is 5 bits.
An embodiment of the present invention further provides a transmitting apparatus, as shown in fig. 3, the apparatus includes:
a data grouping unit 302, configured to divide audio data to be transmitted or a control command for configuring an audio transmission process into N binary code streams with a first preset bit length, where N is an integer greater than 0;
the encoding unit 304 is configured to encode the N binary code streams with the first preset bit length into N binary code streams with a second preset bit length according to a preset rule, where the second preset bit length is greater than the first preset bit length; setting a data frame start flag SOFA or a control frame start flag SOFC at the start position of at least one binary code stream with a second preset bit length 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;
an output unit 306, configured to transmit the M data frames or the M control frames to an audio decoder through a single-wire output interface.
Preferably, the encoding unit 304 is configured to expand N binary code streams of a first preset bit length into N binary code streams of a second preset bit length, where the binary code streams of the second preset bit length include 1 s and 0 s, and the binary code streams of the second preset bit length do not include three consecutive 1 s, and if the first bit of the binary code streams of the second preset bit length is 1, the second bit of the binary code streams of the second preset bit length is 0, and if the last bit of the binary code streams of the second preset bit length is 1, the second last bit of the binary code streams of the second preset bit length is 0.
Preferably, both SOFAs and SOFCs have a first bit of 0 and include three consecutive bit streams of 1.
Preferably, the output unit 306 is configured to output the M data frames or the M control frames serially through the single-wire output interface.
An embodiment of the present invention further provides a receiving apparatus, as shown in fig. 4, the apparatus includes:
a receiving unit 402, configured to receive M data frames or M control frames through a single-wire input interface, where N is an integer greater than 0, and each of the M data frames or M control frames includes at least one binary code stream with a 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 with the second preset bit length, where the SOFA corresponds to a data frame and the SOFC corresponds to a control frame;
the decoding unit 404 is configured to decode the M data frames or the M control frames into N binary code streams with first preset bit lengths according to a preset rule, where the second preset bit length is greater than the first preset bit length.
Preferably, 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 code stream of the second preset bit length includes 1 s and 0 s, and the binary code stream of the second preset bit length does not include three consecutive 1 s, and if the first bit of the binary code stream of the second preset bit length is 1, 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 1, the second last bit of the binary code stream of the second preset bit length is 0.
An embodiment of the present invention further provides a signal interaction system, as shown in fig. 5, the system includes:
a processor 502, configured to divide audio data to be transmitted or a control command for configuring an audio transmission process into N binary code streams with a first preset bit length, where N is an integer greater than 0; coding the N binary code streams with the first preset bit length into N binary code streams with the second preset bit length according to a preset rule, wherein the second preset bit length is larger than the first preset bit length; setting a data frame start flag SOFA or a control frame start flag SOFC at the start position of at least one binary code stream with a second preset bit length 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; transmitting the M data frames or the M control frames to the audio decoder 504 through the single-wire output interface;
an audio decoder 504 for receiving M data frames or M control frames through a single-wire input interface; and decoding the M data frames or the M control frames into N binary code streams with first preset bit lengths according to a preset rule.
According to the invention, the technical scheme that the audio data or the control command to be sent is coded according to the preset rule, and the data frame starting mark or the control frame starting mark is set at the starting position of the coded binary code stream, so that the transmission is carried out through the single-wire output interface is adopted. The problem that audio data and control commands need to be transmitted through a plurality of signal lines in the related art is solved, and the effects of circuit simplification and equipment miniaturization are achieved.
The invention provides a novel audio signal interface, which can transmit unidirectional audio signals by using a single signal wire, supports multi-channel transmission, has variable bit width and sampling rate, can directly transmit configuration information (equivalent to the control command) through the signal wire and does not need a separate configuration interface. The coding mode is far simpler than SPDIF, the logic circuit and software overhead of the interface is low, the method can be widely applied to audio interconnection in equipment, the original audio signal lines such as PCM and I2S are replaced, the original control signal lines such as I2C or SPI are eliminated, and the circuit is greatly simplified. The interface is realized by adopting the following technical means:
for both the control command and the audio data, serial frames are formed in a predetermined format and transmitted over a single signal line.
Between FRAMEs, a distinction is made by a specific START OF FRAME flag (SOF), which is a series OF binary code streams, which only marks the START OF a FRAME and does not appear in other parts OF the FRAME interior. The SOF may have a plurality of SOFs (for example, SOFAs and SOFBs described above) for distinguishing the frames into different categories, for example, the frames may be distinguished into two categories, i.e., audio frames and command frames (corresponding to the control frames described above), for transmitting audio data and control commands, respectively.
In order to convey clock information and avoid SOF in audio data and control commands, a proper SOF needs to be selected and the audio data and control commands are encoded before transmission. One preferred coding scheme is: firstly, dividing audio data and control commands into a plurality of binary groups with the length of 4 bits; secondly, this bin is extended to 5 bits, and the 5 bits satisfy the following three conditions: A) the code must contain 1 and 0, B) 3 continuous 1 do not appear, C) only 1 continuous 1 located at the head and tail of the code; finally, a 5-bit code stream containing consecutive 31 s is used as the SOF.
The coded data is attached behind the SOF to form a frame, and the frame is sent to a single signal wire for transmission through unipolar non-return-to-zero modulation or other baseband modulation methods.
The interface signal line has a default frame length, audio channel number and digital width. After the system is started, the two communication parties communicate in a default format. In the working process, 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 fig. 6, and the whole SYSTEM is composed of a processor SYSTEM HOST SYSTEM, an AUDIO decoder AUDIO CODEC, and an electroacoustic device MIC (Microphone)/SPEAKER (micro SPEAKER). The main processor (corresponding to the processor, referred to as HOST hereinafter) and the AUDIO CODEC are connected by two unidirectional AUDIO signal lines, wherein one line is transmitted from the main processor to the AUDIO CODEC as a control command transmission channel and an AUDIO data transmission channel of the HOST to the AUDIO CODEC, and the other line is transmitted from the AUDIO CODEC (referred to as CODEC hereinafter) to the main processor for transmitting a reverse control command and MIC/speech to receive an ambient sound.
In this embodiment, the digitized audio signal is spread and encoded once every 4 bits, and is spread to 5 bits and then transmitted, and the encoding follows the following rules:
(1) 1 and 0 must be contained within each code to ensure that clock information is carried;
(2) there are no three or more consecutive 1's within all encodings;
(3) the number of the 1 which is continuous from head to tail is only 1 at most, so that three or more continuous 1 can not be generated when a plurality of codes are continuously transmitted;
a typical coding scheme determined according to this principle is shown in table 1:
TABLE 1
Figure BDA0000610625540000091
According to such a coding scheme, the coded 5 bits, no matter they are randomly combined in any order, do not appear to be consecutive 1 s of 3 or more. According to this rule, the present embodiment provides for using as SOF a bitstream 01110 (i.e. 0EH in hexadecimal), 01111 (i.e. 0FH in hexadecimal) and 00111 (i.e. 07H in hexadecimal) containing 3 consecutive 1 s. The two bit streams start with 0 and each internally contain 3 continuous 1, so that the uniqueness of the starting frame is ensured, and the SOF can be detected conveniently by using a simple circuit.
The frame is divided into two types, one is a control frame internally containing a control command, and the other is an audio frame internally containing audio data. In the present embodiment, it is specified that a frame leading with 0EH as SOF is an audio frame, and a frame leading with 0FH as SOF is a control frame. Correspondingly, 0EH is called audio frame flag (SOFA), and 0FH is called command frame flag (SOFC). In this embodiment, the default frame length is 25 bits, using a physical layer communication rate of 200 kbps. Specific frame formats are shown in tables 2 and 3:
TABLE 2 Audio frame Format
…. SOFA Left channel 10 bits Right channel 10 bits ….
……. 01110 XXXXXXXXXX YYYYYYYYYY ………
TABLE 3 Command frame Format
….. SOFC Command word 20 bits …..
……. 01111 ZZZZZZZZZZZZZZZZZZZZ …………
It should be noted that the audio code stream in the frame is encoded and expanded before being framed, and the left and right channels, although appearing to be 10 bits, only carry 8 bits of effective information. The command word is also encoded according to the above method and then sent to the signal line, the command word is 16 bits before encoding, and becomes 20 bits in the frame after encoding.
Since the fixed length of each frame is 25 bits, the data transmission of each frame occupies 125us in accordance with the rate of 200kbps, and the corresponding frame rate is 8kHz when continuously transmitted without an interval. I.e. the default audio signal, is binaural, 8-bit quantized, 8kHz sampling rate.
The effective bit width of the command frame is 16 bits, and in the present embodiment, a specific command is shown in table 4, for example, and command reservations that do not occur in table 4 are not used.
TABLE 4
Figure BDA0000610625540000102
Figure BDA0000610625540000111
In this embodiment, a hardware logic block diagram of the transmitting side is shown in fig. 7. Firstly, audio data and control commands enter an alternative switch, and one path is selected according to requirements. The selected data is subdivided into groups of 4 bits (data packets) and then entered into the encoder, which expands each 4-bit code to 5 bits.
The data with the width of 5 bits enters an alternative switch again, and the switch can select one of the 5-bit data after being coded and SOFA/SOFC according to the requirement and output the selected data to a signal line through a 5-bit shift register controlled by a clock unit. When a0 needs to be transmitted, a logic low level is output, and when a 1 needs to be transmitted, a logic high level is output.
In this embodiment, a hardware logic block diagram of the receiving side is shown in fig. 8. The clock unit extracts phase information of the clock by using high and low level jump of the input signal. The receive clock drives a 5-bit shift register, producing binary data of 5-bit width.
The SOF detection unit continuously detects 5 bits of the 5-bit shift register, and outputs SOF/SOFA/SOFC signals once SOFA or SOFC is detected. Under the control of SOF/SOFA/SOFC signals, the decoding unit and the data merging unit decode 5-bit wide data into 4 bits, and then merge the data into required parallel data.
SOFA and SOFC signals respectively control a command input register and an audio buffer, and send the combined data to the command register or the audio buffer.
The working principle of the present embodiment will be described in more detail below by taking a complete workflow as an example. This operation is illustrated in FIG. 9, where the host and CODEC (audio decoder) are powered up and communicate at a default rate of 200 kbps. The host first switches the communication format to two-channel/8 kHz/16bit wide, then sets the volume of the CODEC to the maximum value, and finally outputs a two-channel 4kHz square wave signal (0 x5050 and 0Xb050 alternately) to the CODEC for playing. The detailed steps are as follows:
1) after the system is powered up, the default rate is 200kbps, but the bidirectional signal lines are idle and constant at low level, both sides receive all 0 signals, and both sides cannot detect SOF, as shown in tables 5 and 6:
table 5 output frame format
………. IDLE IDLE IDLE IDLE IDLE IDLE ……..
………. 00000 00000 00000 00000 00000 00000 ………
00H 00H 00H 00H 00H 00H
Table 6 input frame format
………. IDLE IDLE IDLE IDLE IDLE IDLE ……..
………. 00000 00000 00000 00000 00000 00000 ………
00H 00H 00H 00H 00H 00H
2) After the reset, the software starts to work, and sends a frame control command to the audio decoder through the single-wire interface to inquire whether the audio decoder supports the required format. The frame is preceded by a start flag (SOFC) followed by a CODEC query command 0112H asking if the CODEC can support the two-channel/8 kHz/16bit format. At this time, the audio input signal line (from the CODEC to HOST) still remains in IDLE state, as shown in tables 7 and 8:
table 7 output frame format
Figure BDA0000610625540000121
Table 8 input frame format
………. IDLE IDLE IDLE IDLE IDLE IDLE ……..
………. 00000 00000 00000 00000 00000 00000 ………
00H 00H 00H 00H 00H 00H
3) The CODEC then sends out a reply command 0212H to the host in reply to the data format that can support 2 channel/8 kHz/16 bit. At this time, HOST outputs IDLE status, as in tables 9 and 10:
table 9 output frame format
………. IDLE IDLE IDLE IDLE IDLE IDLE ……..
………. 00000 00000 00000 00000 00000 00000 ………
00H 00H 00H 00H 00H 00H
Table 10 input frame format
4) After the host receives the CODEC's response command, it knows that the CODEC supports the two-channel/8 kHz/16bit format. Whereupon a set command 0312H is sent to the audio decoder to set the new communication mode.
Table 11 output frame format
Figure BDA0000610625540000132
Table 12 input frame format
……… IDLE IDLE IDLE IDLE IDLE IDLE ……..
……… 00000 00000 00000 00000 00000 00000 ………
00H 00H 00H 00H 00H 00H
5) Immediately after the host issues the command, the output frame format is switched to, for example, table 13 and table 14:
TABLE 13 Audio frame Format
……. Frame start Left channel 20 bits Right channel 20 bits …….
01110 XXXXXXXX YYYYYYYY
Table 14 command frame format
Frame start Command word 20 bits Free 20 bits …..
….. 01111 ZZZZZZZZ ……….
Since the new frame length is 45 bits, the frame rate is still 8k, and the communication rate of the physical layer is changed to 45 × 8 k-360 kbps.
The CODEC also configures the receiving circuitry to the frame format and communication rate described above immediately upon receiving the communication format update command.
6) The host sends a configuration command to the audio decoder with the new frame format to set the volume to maximum, the corresponding set command being 047 FH. Because the new frame length has become longer, the IDLE is output for the length that the command does not occupy. At this time, the audio input signal line still maintains the IDLE state, as shown in tables 15 and 16:
table 15 output frame format
Figure BDA0000610625540000141
Table 16 input frame format
………. IDLE IDLE IDLE IDLE IDLE IDLE ……..
………. 00000 00000 00000 00000 00000 00000 ………
00H 00H 00H 00H 00H 00H
7) 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 the HOST, which is in standby mode and the output signal remains idle, as in tables 17 and 18:
table 17 output frame format
…… IDLE IDLE IDLE IDLE IDLE IDLE ……..
…… 00000 00000 00000 00000 00000 00000 ………
00H 00H 00H 00H 00H 00H
Table 18 input frame format
8) After the HOST receives the response message from the CODEC, it begins transmitting audio data to the audio decoder, with the audio input signal line in an idle state. The audio data output by the HOST is cyclic 5050H and a050H, each of which is sent twice, representing the left and right channels, respectively, as in tables 19 and 20:
table 19 output frame format
Figure BDA0000610625540000152
Table 20 input frame format
………. IDLE IDLE IDLE IDLE IDLE IDLE ……..
………. 00000 00000 00000 00000 00000 00000 ………
9) After the CODEC receives the cyclic 5050H and A050H, the square wave is output to SPEAKER through ADC (Analog-to-Digital Converter) and power amplifier, and an alarm sound is given.
In another embodiment, a software is provided, which is used to execute the technical solutions described in the above embodiments and preferred embodiments.
In another embodiment, a storage medium is provided, in which the software is stored, and the storage medium includes but is not limited to: optical disks, floppy disks, hard disks, erasable memory, etc.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (6)

1. A method for transmitting a signal, comprising:
dividing audio data to be transmitted or a control command for configuring an audio transmission process into N binary code streams with first preset bit lengths, wherein N is an integer greater than 0;
coding the N binary code streams with the first preset bit length into N binary code streams with second preset bit length according to a preset rule, wherein the second preset bit length is larger than the first preset bit length;
setting a data frame start flag SOFA or a control frame start flag SOFC at the start position of at least one binary code stream with the second preset bit length, and generating M data frames or M control frames, wherein the SOFA corresponds to the audio data, the SOFC corresponds to the control command, and M is not more than N;
outputting the M data frames or the M control frames through a single-wire output interface;
wherein the first preset bit length is 4 bits, and the second preset bit length is 5 bits; the encoding the N binary code streams with the first preset bit length into N binary code streams with the second preset bit length according to a preset rule includes:
expanding the N first binary code streams with a first preset bit length into N second binary code streams with a second preset bit length, wherein the second binary code streams with the second preset bit length include 1 s and 0 s, the second binary code streams with the second preset bit length do not include three consecutive 1 s, and if the first bit of the second binary code stream with the second preset bit length is 1, the second bit of the second binary code stream with the second preset bit length is 0; and if the last bit of the binary code stream with the second preset bit length is 1, the second last bit of the binary code stream with the second preset bit length is 0.
2. The method according to claim 1, wherein both the SOFA and the SOFC have a first bit of 0 and comprise three consecutive bit streams of 1.
3. A method for receiving a signal, comprising:
receiving M data frames or M control frames through a single-wire input interface, wherein each of the M data frames or the M control frames comprises at least one binary code stream with a second preset bit length and a data frame start flag SOFA or a control frame start flag SOFC which is arranged at the start position of the binary code stream with the second preset bit length, wherein the SOFA corresponds to the data frame and the SOFC corresponds to the control frame;
decoding the M data frames or the M control frames into N binary code streams with first preset bit lengths according to a preset rule, wherein 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;
the SOFA and the SOFC both have a first bit of 0 and comprise three continuous bit code streams of 1;
the first preset bit length is 4 bits, and the second preset bit length is 5 bits; the decoding the M data frames or the M control frames into N binary code streams with a first preset bit length according to a preset rule includes:
decoding the M data frames or the M control frames into the N first binary code streams with the first preset bit length, wherein the second binary code stream with the second preset bit length includes 1 and 0, and the second binary code stream with the second preset bit length does not include three consecutive 1 s, and if the first bit of the second binary code stream with the second preset bit length is 1, the second bit of the second binary code stream with the second preset bit length is 0, and if the last bit of the second binary code stream with the second preset bit length is 1, the second last bit of the second binary code stream with the second preset bit length is 0.
4. A transmitting apparatus, comprising:
the data grouping unit is used for dividing audio data to be sent or a control command for configuring an audio transmission process into N binary code streams with first preset bit lengths, wherein N is an integer greater than 0;
the encoding unit is used for encoding the N binary code streams with the first preset bit length into N binary code streams with second preset bit length according to a preset rule, wherein the second preset bit length is larger than the first preset bit length; setting a data frame start flag SOFA or a control frame start flag SOFC at the start position of at least one binary code stream with the second preset bit length, and generating M data frames or M control frames, wherein the SOFA corresponds to the audio data, the SOFC corresponds to the control command, and M is not more than N;
the output unit is used for outputting the M data frames or the M control frames through a single-wire output interface;
the encoding unit is configured to expand the N first binary code streams with a preset bit length into N second binary code streams with a preset bit length, where the second binary code streams with the preset bit length include 1 s and 0 s, and the second binary code streams with the preset bit length do not include three consecutive 1 s, and if a first bit of the second binary code stream with the preset bit length is 1, a second bit of the second binary code stream with the preset bit length is 0, and if a last bit of the second binary code stream with the preset bit length is 1, a second last bit of the second binary code stream with the preset bit length is 0; the SOFA and the SOFC both have a first bit of 0 and comprise three continuous bit code streams of 1.
5. A receiving apparatus, comprising:
a receiving unit, configured to receive M data frames or M control frames through a single-wire input interface, where each of the M data frames or the M control frames includes at least one binary code stream with a second preset bit length and a data frame start flag SOFA or a control frame start flag SOFC that is set at a start position of the binary code stream with the second preset bit length, where 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;
a decoding unit, configured to decode the M data frames or the M control frames into N binary code streams with 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 is configured to decode the M data frames or the M control frames into the N first binary code streams with the first preset bit length, where the second binary code stream with the second preset bit length includes 1 s and 0 s, and the second binary code stream with the second preset bit length does not include three consecutive 1 s, and if the first bit of the second binary code stream with the second preset bit length is 1, the second bit of the second binary code stream with the second preset bit length is 0, and if the last bit of the second binary code stream with the second preset bit length is 1, the second last bit of the second binary code stream with the second preset bit length is 0.
6. A signal interaction system, comprising:
the processor is used for dividing audio data to be transmitted or a control command for configuring an audio transmission process into N binary code streams with first preset bit lengths, wherein N is an integer greater than 0; coding the N binary code streams with the first preset bit length into N binary code streams with second preset bit length according to a preset rule, wherein the second preset bit length is larger than the first preset bit length; setting a data frame start flag SOFA or a control frame start flag SOFC at the start position of at least one binary code stream with the second preset bit length, and generating M data frames or M control frames, wherein the SOFA corresponds to the audio data, the SOFC corresponds to the control command, and M is not more than N; transmitting the M data frames or the M control frames to an audio decoder through a single-wire output interface; wherein the first preset bit length is 4 bits, and the second preset bit length is 5 bits; the encoding the N binary code streams with the first preset bit length into N binary code streams with the second preset bit length according to a preset rule includes:
expanding the N first binary code streams with a first preset bit length into N second binary code streams with a second preset bit length, wherein the second binary code streams with the second preset bit length include 1 s and 0 s, the second binary code streams with the second preset bit length do not include three consecutive 1 s, and if the first bit of the second binary code stream with the second preset bit length is 1, the second bit of the second binary code stream with the second preset bit length is 0; if the last bit of the binary code stream with the second preset bit length is 1, the second last bit of the binary code stream with the second preset bit length is 0;
the audio decoder is used for receiving the M data frames or the M control frames through a single-wire input interface; and decoding the M data frames or the M control frames into the N binary code streams with the first preset bit length according to a preset rule.
CN201410660404.3A 2014-11-18 2014-11-18 Method, device and system for transmitting and receiving signals Active CN105681819B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410660404.3A CN105681819B (en) 2014-11-18 2014-11-18 Method, device and system for transmitting and receiving signals
PCT/CN2015/074793 WO2016078271A1 (en) 2014-11-18 2015-03-20 Signal sending and receiving method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410660404.3A CN105681819B (en) 2014-11-18 2014-11-18 Method, device and system for transmitting and receiving signals

Publications (2)

Publication Number Publication Date
CN105681819A CN105681819A (en) 2016-06-15
CN105681819B true CN105681819B (en) 2020-01-07

Family

ID=56013168

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410660404.3A Active CN105681819B (en) 2014-11-18 2014-11-18 Method, device and system for transmitting and receiving signals

Country Status (2)

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

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110086549B (en) * 2019-04-02 2021-09-14 北京小米移动软件有限公司 Audio data transmission method and device
CN110312146B (en) * 2019-06-06 2021-11-09 百度在线网络技术(北京)有限公司 Audio processing method and device, electronic equipment and storage medium
CN113539280A (en) * 2020-04-16 2021-10-22 华为技术有限公司 Control signal sending method, control signal receiving method and related equipment
CN113204507A (en) * 2021-04-25 2021-08-03 山东英信计算机技术有限公司 Universal input/output data transmission method, device, equipment and medium
CN115243238A (en) * 2022-06-30 2022-10-25 哲库科技(上海)有限公司 Device and method for transmitting audio data and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0815664A4 (en) * 1995-03-15 1999-11-24 Motorola Inc Method and apparatus for organizing and recovering information communicated in a radio communication system
CN101485212A (en) * 2006-05-02 2009-07-15 高级网络技术有限公司 Method and system for wireless real-time transmission of multichannel audio or video data
CN101557509A (en) * 2008-04-07 2009-10-14 清华大学 Method for transmitting mobile multimedia compatible with terrestrial digital terrestrial television transmission standard
CN101594328A (en) * 2008-05-30 2009-12-02 佳能株式会社 Communication system and control method thereof

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB9903900D0 (en) * 1999-02-19 1999-04-14 Digital Gramaphone And Wireles Data encoding/decoding device and apparatus using the same
JP2003152898A (en) * 2001-11-12 2003-05-23 Nec Eng Ltd Phone terminal equipment
CN101272500B (en) * 2008-05-14 2010-12-01 中兴通讯股份有限公司 Transmission method and system for video/audio data flow
CN101764672B (en) * 2009-07-24 2013-10-09 美的集团股份有限公司 Checking system for data communication of electromagnetic oven and application method thereof
CN103379397B (en) * 2012-04-26 2017-06-13 国民技术股份有限公司 Data transfer, treatment, the signal processing method based on COBBAIF and module
CN103402007A (en) * 2013-07-26 2013-11-20 广州史达泊雷网络科技有限公司 Audio interface-based data transmission method between intelligent terminal and operating handle

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0815664A4 (en) * 1995-03-15 1999-11-24 Motorola Inc Method and apparatus for organizing and recovering information communicated in a radio communication system
CN101485212A (en) * 2006-05-02 2009-07-15 高级网络技术有限公司 Method and system for wireless real-time transmission of multichannel audio or video data
CN101557509A (en) * 2008-04-07 2009-10-14 清华大学 Method for transmitting mobile multimedia compatible with terrestrial digital terrestrial television transmission standard
CN101594328A (en) * 2008-05-30 2009-12-02 佳能株式会社 Communication system and control method thereof

Also Published As

Publication number Publication date
WO2016078271A1 (en) 2016-05-26
CN105681819A (en) 2016-06-15

Similar Documents

Publication Publication Date Title
CN105681819B (en) Method, device and system for transmitting and receiving signals
US9167349B2 (en) Method and apparatus for reproducing multi-channel sound using cable/wireless device
EP1665877B1 (en) Wireless digital transmission of low frequency effects and surround channels for surround sound system
US20170257702A1 (en) Low power synchronous data interface
US8315724B2 (en) Wireless audio streaming transport system
CN104981790A (en) Multi-slot multi-point audio interface
CN108885880A (en) For disposing the silent system and method in audio stream
CN110248285B (en) Multi-channel audio equipment
CN107277691B (en) Multi-channel audio playing method and system based on cloud and audio gateway device
US10305670B2 (en) Digital accessory interface
CN110085241A (en) Data-encoding scheme, device, computer storage medium and data encoding apparatus
CN103209269A (en) Zigbee-technology-based digital wireless multi-channel audio conference method and device
CN110838298A (en) Method, device and equipment for processing multi-channel audio data and storage medium
JPH08298516A (en) Digital data transmission method and its application
KR102509805B1 (en) radio communication
JPS63252083A (en) Picture coding transmitter
KR100456960B1 (en) System for transmitting and receiving audio data using Digital Audio Broadcasting
KR100478592B1 (en) DSP Scheduling Control Method
US7680069B2 (en) PCM type interface
JP2001069095A (en) Digital disaster prevention radio system
JP2890563B2 (en) PCM speech encoding method and apparatus
KR100371746B1 (en) Multi-channel audio multiplexing apparatus for multimedia and method therefor
KR100561434B1 (en) Multi-channel audio system
JPS63232589A (en) System for making band in sound-picture transmitting frame variable
JP2021064880A (en) Wired communication system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant