Summary of the invention
The method that the purpose of this invention is to provide automatic switchover digital audio broadcasting signal and FM signal with by monitoring simultaneously DAB signal and FM signal, by the time difference of two signals of power calculation, and is carried out smoothing processing output mixed signal when switching signal.
For achieving the above object, the invention provides a kind of method of automatically switch digital audio broadcasting signal and FM signal, the method comprises:
Digital audio broadcasting signal and the FM signal of the same program source that gets access to are decoded respectively;
Decoded digital audio broadcasting signal and FM signal are carried out respectively buffer memory, comprise DAB decoded signal and signal quality information in the described decoded digital audio broadcasting signal;
Read described decoded digital audio broadcasting signal and the FM signal of buffer memory, and according to the power of the described decoded FM signal of described buffer memory and the power of DAB decoded signal, and signal quality information, obtain DAB decoded signal in the described decoded digital audio broadcasting signal and the time difference between the FM signal; And
According to described signal quality information and described time difference, select DAB decoded signal in the digital audio broadcasting of described buffer memory or decoded FM signal as switching signal, perhaps mix DAB decoded signal in the described decoded digital audio broadcasting signal of institute's buffer memory and decoded FM signal as switching signal.
Describedly decoded digital audio broadcasting signal and FM signal are carried out respectively buffer memory be specially, described decoded digital audio broadcasting signal and FM signal are carried out buffer memory by the first in first out buffer respectively.
The power of described decoded FM signal according to buffer memory and the power of DAB decoded signal, and signal quality information, the time difference of obtaining between described decoded digital audio broadcasting signal and the FM signal is specially:
When described signal quality information is characterized by when not being cached with the data that write when existing digital audio broadcasting signal bad,
Obtain the second power of each frame of first power of each frame of described digital audio broadcasting signal and FM signal;
Obtain the correlation function of described the first power and the second power;
Choose the maximum of described correlation function argument;
With the product of the value of the sampled point of each frame of described maximum and described digital audio broadcasting signal as the described time difference.
DAB decoded signal in the described decoded digital audio broadcasting signal of described mixing institute buffer memory and decoded FM signal are carried out smoothing processing during as switching signal.
The described smoothing processing of carrying out is specially:
If current what choose is decoded frequcny modulation data, and when described signal quality information is characterized by when not being cached with the data that digital audio broadcasting signal writes when bad, then in the time of next digital audio broadcasting signal frame, export mixed signal, after this outputting digital audio broadcast singal; Perhaps
If current what choose is decoded digital video broadcast data, and when described signal quality information is characterized by when being cached with the data that digital audio broadcasting signal writes when bad, then in the time of next digital audio broadcasting signal frame, export mixed signal, after this export FM signal.
A further object of the present invention provides the device of automatic switchover digital audio broadcasting signal and FM signal, with by monitoring simultaneously DAB signal and FM signal, by the time difference of two signals of power calculation, and when switching signal, carry out smoothing processing output mixed signal.
The present invention also provides a kind of device of automatically switch digital audio broadcasting signal and FM signal to achieve these goals, and this device comprises:
The digital audio broadcasting signal decoder is decoded for the digital audio broadcasting signal of the same program source that will get access to;
The frequency modulated signal decoding device is decoded for the FM signal of the same program source that will get access to;
The digital audio broadcasting signal buffer is used for decoded digital audio broadcasting signal is carried out buffer memory, comprises signal quality information in the described decoded digital audio broadcasting signal;
The FM signal buffer is used for decoded FM signal is carried out buffer memory;
Lock in time calculator, be used for reading described decoded digital audio broadcasting signal and the FM signal of buffer memory, and according to the power of the described decoded FM signal of described buffer memory and the power of DAB decoded signal, and signal quality information, obtain the time difference between described decoded digital audio broadcasting signal DAB decoded signal and the FM signal; And
The signal gating mixture control, be used for according to described signal quality information and described time difference, select the decoded digital audio broadcasting signal DAB decoded signal of described buffer memory or FM signal as switching signal, perhaps mix the described decoded digital audio broadcasting signal DAB decoded signal of the buffer memory that reads and FM signal as switching signal.Described digital audio broadcasting signal buffer and FM signal buffer are respectively the first in first out buffer.
Described lock in time, calculator specifically comprised:
The power acquiring unit, be used for being characterized by when not being cached with the data that write when existing digital audio broadcasting signal bad when described signal quality information, obtain the second power of each frame of first power of each frame of described digital audio broadcasting signal and FM signal;
The correlation function value acquiring unit is for the correlation function that obtains described the first power and the second power;
Determining unit is used for choosing the maximum of described correlation function argument, with the product of the value of the sampled point of each frame of described maximum and described digital audio broadcasting signal as the described time difference.Described signal gating mixture control comprises the smoothing processing device, is used for during as switching signal, carrying out smoothing processing in the DAB decoded signal of the described decoded digital audio broadcasting signal of described mixing institute buffer memory and decoded FM signal.
Described smoothing processing implement body comprises:
The first signal output unit, current what choose is decoded frequcny modulation data if be used for, and when described signal quality information is characterized by when not being cached with the data that digital audio broadcasting signal writes when bad, then in the time of next digital audio broadcasting signal frame, export mixed signal, after this outputting digital audio broadcast singal; And/or
The secondary signal output unit, be used for that current what choose is decoded digital video broadcast data, and when described signal quality information is characterized by when being cached with the data that digital audio broadcasting signal writes when bad, then in the time of next digital audio broadcasting signal frame, export mixed signal, after this export FM signal.
The present invention has realized utilizing the power calculation time difference to obtain corresponding DAB signal and FM signal by the method and apparatus of automatic switchover digital audio broadcasting signal and FM signal, automatically switch, and in order to make sound continuous, carried out smoothing processing during the course.
Embodiment
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
As shown in Figure 1, be the automatically switch flow chart of method of digital audio broadcasting signal and FM signal of the present invention.Fig. 2 is the automatically switch structural representation of device of digital audio broadcasting signal and FM signal of the present invention.As seen from Figure 2, the device of this automatic switchover digital audio broadcasting signal and FM signal by digital audio broadcasting signal (DAB)decoder 21, FM signal (FM)decoder 22, digital audiobroadcasting signal buffer 23,FM signal buffer 24, lock intime calculator 25 and signalgating mixture control 26 form.This device also can compriseplayer 27.
In conjunction with Fig. 1 and Fig. 2, the inventive method is described, specifically may further comprise the steps:
Step 11, digital audio broadcasting signal and the FM signal of the same program source that DAB decoder and FM decoder will get access to are decoded respectively;
Step 12, DAB buffer and FM buffer carry out respectively buffer memory with decoded digital audio broadcasting signal and FM signal, comprise DAB decoded signal and signal quality information in the described decoded digital audio broadcasting signal;
When the DAB decoder is decoded to the DAB signal, this DAB decoder is not only decoded to a frame DAB signal, also obtain simultaneously signal quality information, therefore in the decoded DAB signal, not only include the DAB decoded signal, also have signal quality information, be written to together subsequently in the buffering area of DAB buffer; Described decoded digital audio broadcasting signal and FM signal are carried out buffer memory by the first in first out buffer respectively, and length is roughly 0.5-2 second.
Step 13, lock in time, calculator read described decoded digital audio broadcasting signal and the FM signal of buffer memory, and the power according to FM signal after the described decoding of described buffer memory, the power and signal quality information of DAB decoded signal obtains the time difference between the DAB decoded signal and FM signal in the described decoded digital audio broadcasting signal;
Step 14, the signal gating mixture control is according to described signal quality information and described time difference, select DAB decoded signal in the decoded digital audio broadcasting signal of described buffer memory or FM signal as switching signal, perhaps mix the DAB decoded signal of described decoded digital audio broadcasting signal of the buffer memory that reads and FM signal as switching signal.
Because the DAB coded system is to carry out lossy coding at frequency domain, and Frequency Domain Coding has utilized people's ear for the insensitive characteristic of sound phase place, so after the decoding reduction, larger variation has occured in the form in detail of the information on its time domain, but the variation of phase place does not cause the variation of one section slightly long-time energy, so can calculate the energy of a period of time signal, and then by relevant mode computing time.
If the data in the DAB buffer are by M sampled point, according to time sequencing difference D0, D1, D2, D3......DM-1, data in the FM buffer are by N sampled point, according to time sequencing be respectively respectively F0, F1, F2, F3 ... FN-1, the sample rate of data is S (being between Da and the Da-1 or the time phase difference 1/S of Fa and Fa-1), and the every frame of DAB signal comprises L sampled point.Needs roughly differ from t computing time, and namely Da and Fa-t are the signal of same time.Therefore,step 13 is specially:
When DAB decodes a frame and is written in the DAB buffering area, if the data that write when not having the DAB poor signal in this buffering area, namely the signal quality information of institute's buffer memory is characterized by and is not cached with the data that write when existing digital audio broadcasting signal bad in the DAB buffer.
Step 131 is obtained the second power of each frame length of first power of each frame length of DAB decoded signal and decoded FM signal;
Namely calculate power P D0, PD1, PD2......, the PDm of each frame length of DAB decoded signal in the buffer, wherein
M=[M/L], wherein, bracket is for rounding operation downwards, and for example [4.7]=4 are lower same
Power FD0, the FD1 of decoded each frame length of FM signal, FD2......, FDn are wherein in the calculating buffer
N=[N/L], wherein, bracket is for rounding operation downwards
Step 132 is obtained the correlation function R (x) of described the first power and the second power;
The span of x is [m/2]+6-n≤x≤[m/2]-4, and wherein, bracket is for rounding operation downwards;
Step 133 is chosen the maximum of described correlation function argument x; With the product t=x * L of the sum of the sampled point of each frame of described maximum and described digital audio broadcasting signal as the described time difference.
Except above-mentioned situation, when the DAB decoder decoded in the buffering area that a frame is written to the DAB buffer, if find that wherein the signal quality information of buffer memory shows the data that write when having the DAB poor signal in this buffering area, then t was constant.Because this time, the DAB quality is not good, so may there be mistake in the data that decode, the t that utilize misdata to calculate this moment is insecure, so use the t that last time, correct signal solved, the initial value of t is made as 0.
At first, the signal gating mixture control is selected exportable play signal, and initial conditions are: the junior one is equivalent to the data in the gating FM decoded data buffer memory among the routine 0.5m described above of time of the maximum data that can store of DAB buffer behind system reset.Do not satisfying under this condition,
Be data in the FM decode buffer if current play signal is selected, if signal quality information is characterized by data when having poor signal in the DAB buffer, then continue the data in the gating FM decoded data buffer memory;
Be data in the DAB decode buffer if current play signal is chosen, if signal quality information is characterized by data when not having poor signal in the DAB decode buffer, then continue the data in the gating DAB decoded data buffer memory.Above-mentioned both of these case is existing situation.
The signal gating mixture control is selected exportable play signal, and its basic principle is that selection DAB signal when the DAB signal is not good, is selected the FM signal when the DAB signal quality has been.But in the present invention, continuous in order to make sound in the process that play signal is switched, adopt the mode that adds triangular window to carry out transition.The DAB decoded signal that is the method in the described decoded digital audio broadcasting signal of described mixing institute buffer memory and decoded FM signal are during as switching signal, carry out smoothing processing, export to player as play signal through the switching signal of smoothing processing.The below specifies this smoothing processing process:
Namely in this embodiment, in the situation that does not satisfy initial condition, data in the FM decoding buffer memory if current play signal is chosen, if signal quality information is characterized by the data when not having poor signal in the buffer memory in the DAB decode buffer, then export mixed signal in the time of a DAB frame length under connecing, and export in the back the DAB signal, specific as follows:
If the mixed signal of the current buffering area of delivering to player that will read is A0, the back is followed successively by A1, A2, A3......, and a upper signal of choosing is A-1, and the signal that correspondence is chosen is Fc-1,, then
F whereinC+xAnd DC+t+xBe the signal of same time, t refers to the time difference, wherein selects DAB data DC+t+xFM data F with correspondenceC+xTo select by the time difference t that the mode of above-mentionedsteps 13 is calculated.
Except above-mentioned situation, also comprise following this situation: in the situation that does not satisfy initial condition, data in the DAB decode buffer if current play signal is chosen, if signal quality information is characterized by the data when having poor signal in the buffering in the DAB decode buffer, then export mixed signal in the time of a DAB frame length under connecing, and export in the back the FM signal, specific as follows:
If the mixed signal in the current buffering area of delivering to player that will read is A0, the back is followed successively by A1, A2, A3......, and a upper signal of choosing is A-1, and the signal that correspondence is chosen is Dc-1, then
D whereinC+xAnd FC+t+xBe the signal of same time, t refers to the time difference, wherein selects DAB data DC+t+xFM data F with correspondenceC+xTo select by the time difference t that the mode of above-mentionedsteps 13 is calculated.
When above-mentioned signal gating mixture control is selected switching signal as play signal, to automatically switch to the FM signal during to traditional poor signal as DAB, and the method that switches to the DAB signal when the DAB signal is normal has been made improvement, namely it has been carried out smoothing processing output mixed signal, thereby so that sound is not only continuous, and effect is better.
The present invention also provides another embodiment, it is execution in step 11 to 13, namely utilize in thestep 13 and calculate the time difference according to power, thereby find DAB signal and the FM signal of same time, afterwards according to described signal quality information and described time difference, select the decoded digital audio broadcasting signal of described buffer memory or FM signal as switching signal, that is to say in the situation that does not satisfy initial condition, data in the FM decoding buffer memory if current play signal is chosen, if signal quality information is characterized by the data when not having poor signal in the buffer memory in the DAB decode buffer, then in the time of a DAB frame length under connecing with the DAB signal as switching signal, export to player as play signal; Perhaps in the situation that does not satisfy initial condition, data in the DAB decode buffer if current play signal is chosen, if signal quality information is characterized by the data when having poor signal in the buffering in the DAB decode buffer, then in the time of a DAB frame length under connecing with the FM signal as switching signal, export to player as play signal.
The present invention monitors DAB signal and FM signal simultaneously, by the time difference of two signals of power calculation, when the DAB signal is not good, play the audio frequency of FM signal, after the DAB signal recovers well, continue to play the audio frequency of DAB signal, but in order to make sound continuous, carried out smoothing processing during the course.
Continue as shown in Figure 2, wherein DAB decoder and FM decoder are all basic identical with traditional decoder.Different is, the two is worked simultaneously in this device, and the signal of decoding is the identical program that sends with DAB and FM mode.Two decoders directly do not output toplayer 27 with decoded signal, but output to buffer memory inDAB buffer 23 and the FM data device 24.The sample rate ofFM decoder 22 outputs is identical with DAB decoder 21.DAB buffer, FM buffer are the FIFO buffer memorys of two storage decoded datas, and length is roughly 0.5-2 second.
DAB decoding signals 21 in the device of this automatic switchover DAB signal and FM signal is decoded for the digital audio broadcasting signal of the same program source that will get access to;FM signal 22 decoders are decoded for the FM signal of the same program source that will get access to;DAB signal buffer 23 is used for decoded digital audio broadcasting signal is carried out buffer memory, comprises DAB decoded signal and signal quality information in the described decoded digital audio broadcasting signal;FM signal buffer 24 is used for decoded FM signal is carried out buffer memory; Lock in time,calculator 25, be used for reading described decoded digital audio broadcasting signal and the FM signal of buffer memory, and according to the power of the described decoded FM signal of described buffer memory and the power of DAB decoded signal, and signal quality information, obtain the time difference between described decoded digital audio broadcasting signal and the FM signal; Signalgating mixture control 26, be used for according to described signal quality information and described time difference, select the decoded DAB decoded signal of described buffer memory or FM signal as switching signal, perhaps mix DAB decoded signal in the described decoded digital audio broadcasting signal of the buffer memory that reads and FM signal as switching signal.
As shown in Figure 2, this,calculator 25 specifically comprised lock in time:
Power acquiring unit 251, be used for being characterized by when not being cached with the data that write when existing digital audio broadcasting signal bad when described signal quality information, obtain the second power of each frame of first power of each frame of described digital audio broadcasting signal and FM signal;
Correlation functionvalue acquiring unit 252 is for the correlation function that obtains described the first power and the second power;
Determiningunit 253 is used for choosing the maximum of described correlation function argument, with the product of the value of the sampled point of each frame of described maximum and described digital audio broadcasting signal as the described time difference.
Comprise smoothingprocessing device 261 in the signalgating mixture control 26, be used for during as switching signal, carrying out smoothing processing in the DAB decoded signal of the described decoded digital audio broadcasting signal of described mixing institute buffer memory and decoded FM signal.Except this smoothingprocessing device 261, also can also comprise for according to described signal quality information and described time difference, select the decoded digital audio broadcasting signal of described buffer memory or FM signal as theswitch 262 of switching signal.Signal gatingmixture control 26 also can have smoothingprocessing device 261 and switch 262 simultaneously, perhaps has separately.
Described smoothingprocessing device 261 specifically comprises:
Firstsignal output unit 2611, current what choose is decoded frequcny modulation data if be used for, and when described signal quality information is characterized by when not being cached with the data that digital audio broadcasting signal writes when bad, then in the time of next digital audio broadcasting signal frame, export mixed signal, after this outputting digital audio broadcast singal; And/or
Secondarysignal output unit 2612, be used for that current what choose is decoded digital video broadcast data, and when described signal quality information is characterized by when being cached with the data that digital audio broadcasting signal writes when bad, then in the time of next digital audio broadcasting signal frame, export mixed signal, after this export FM signal.
In with signal gating mixture control specific product, first signal output unit and secondary signal output unit can possess simultaneously, also can only possess one.
Computing time poor and smoothing processing detailed process, as above-mentioned described in the method, do not repeat them here.
The present invention has realized utilizing the power calculation time difference to obtain corresponding DAB signal and FM signal by the device of automatic switchover digital audio broadcasting signal and FM signal, automaticallyes switch, and during the course in order to make sound continuous, has carried out smoothing processing.The present invention has processed effectively not to be had well to estimate may receive the time difference that exists between DAB and the FM, and do not advance process row smoothing processing to automaticallying switch, cause these problems of sound continuity weak effect, the user is switched in the situation of subjective sensation not having.
The professional should further recognize, unit and the algorithm steps of each example of describing in conjunction with embodiment disclosed herein, can realize with electronic hardware, computer software or the combination of the two, for the interchangeability of hardware and software clearly is described, composition and the step of each example described in general manner according to function in the above description.These functions are carried out with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.The professional and technical personnel can specifically should be used for realizing described function with distinct methods to each, but this realization should not thought and exceeds scope of the present invention.
The method of describing in conjunction with embodiment disclosed herein or the step of algorithm can use the software device of hardware, processor execution, and perhaps the combination of the two is implemented.The software device can place the storage medium of any other form known in random asccess memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or the technical field.
Above-described embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is the specific embodiment of the present invention; the protection range that is not intended to limit the present invention; within the spirit and principles in the present invention all, any modification of making, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.