Hi,guys! I'm vcp2 to perform viterbi decoding. VCP2 could put out hard decision and soft decision. I'm wondering how can I get hard information(0 and 1) from the soft decision?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,guys! I'm vcp2 to perform viterbi decoding. VCP2 could put out hard decision and soft decision. I'm wondering how can I get hard information(0 and 1) from the soft decision?
Hi Kaiqi,
The VCP2 produces soft decisions as 8-bit signed integers. You can use the sign-bit in order to get hard decisions (0 or 1) from the soft decisions data i.e. a negative sign-bit corresponds to 0 and positive sign-bit corresponds to 1.
Regards
-Nitin
Hi Sakhuja,
Another problem which puzzled me is how to quantize the soft input. In the c6474 vcp2 user's guide, it only refers a scaling factor, could you tell me the whole quantization process?
Hello,
First, soft output is kind of reliability measure of decoded bit, so you may think that large positive values likely zeros and large negative - ones, while smaller values are less definite. So, as it was suggested, you may just count whether value is positive or negative. However, I believe that receiving soft output makes sense if next stage of processing can make use of bit "quality", i.e. when convolutional code is concatenated with other soft input (de)coding scheme. Otherwise you better let VCP produce had decisions for you and pack them. This way you would save not only on making hard decision by CPU, but also on EDMA bandwidth to receive decisions from accelerator.
As to quantization, I found user guide to be very clear, so I don't really understand your trouble. You may think of VCP as accelerator which performs mainly addition operations. With integers summ grows and may overflow if many additions performed. So input to VCP must be scaled in a way, that prevents overflow. Obviously, number of addition stages depends on code rate, this is a reason for that formula in user manual. So you may think, you have to control gain of your Amp-ADC chain. Of course, you can do that in software by multiplication. Floating point scaling would be costly to you, so I suggest some inaccurate but cheaper scaling. This way quality of input data may degrade a little, but you'll save a lot of calculations.
I don't understand what how to quantize the soft input with the scaling factor(simply multiply the soft input with the scaling factor?). Another question is that soft input is required in vcp2, does it mean we should use BPSK soft demodulation?
Greetings,
As to quantization, you have to understand the final goal. This final goal is to present VCP with inputs within its dynamic range. Literally, you have to assure, that absolute values of inputs do not exceed certain threshold. To accomplish that you may simply multiply your data with proper scaling factor. However, there could be some other degrees of freedom. You may reduce receiver's gain, or switch to higher attenuator stage - every approach has pro & con.
As to the second question, BPSK is just simple example always used for the sake of clarity. You can easily adapt this approach to QPSK modulation. You get a constellation point with coordinates of (i,q). Then, you take real part, namely 'i' and use it as soft decision of one bit and imaginary 'q' as soft decision of other bit. Higher order QAM require a little bit more examination. I suggest you excellent tutorial on QAM16 soft decision quantization by Krishna Sankar Softbit for 16QAM.
rrlagic:
Thanks for your answer. I do know the final goal of quantization is to present VCP with inputs within its dynamic range. But in reality, the quanlity of channel is unknown, it's difficult to decide a proper scaling factor.
As to the second question. The goal of my program is to make it simple demonstrate. If I want to use BPSK in my program, could you give me some example of BPSK soft demodulation?
ps:the link you gives is unavailable.
Greetings,
Choosing proper scaling is the art usually embedded in the specification of your system. In wireless communications we design transmission in a way, that helps receiver to adjust itself. If we speak about OFDM system, then there should be some pilot or reference carriers, whose modulation is known a priori. The receiver performs equalizations step first. So, if you received some input, then know where are reference signals, you can estimate channel response and adjust your equalizer. In reality, there some more steps done by hardware of lower level. In your receiver chain there might be a power detector and, probably, AGC chain, which adjusts gain of the amplifier. This way we assure ADC is presented with input of its dynamic range. ADC output usually go through some digital processing chain, like filtering. There again you can adjust the gain, though I believe calculation of equalizer based on reference signals is designed approach.
Keep in mind, that is just one of possible solutions. Other standards use preambles to let receiver adjust.
As to the second question, I can give you only idea. Even BPSK modulation can defined in several ways. Suppose we have quadrature receiver. Suppose A is magnitude of the constellation and 0 is defined as (I,Q) = (A, 0), while 1 is defined as (-A, 0). Suppose you receive samples as 16 bit packed integers, i.e. your bugger contains interlaced I and Q samples of int16. Suppose equalization step has been performed. Then you just drop, don't use Q samples and scale I samples. Suppose equalization step makes magnitude A = 140. Then for code rate 1/2 we have to scale to [-64;63] range, so we have to multiply all samples with ScF = 64/140. It seems you have floating point core, so it might not cost you too much to multiply with floating constant. People of integer world would find some cheaper solution . For example, right shift by 2 will divide by 4 and make inputs within VCP's dynamic range at the expense of a bit degraded power.
So, again, you pick up 'I' samples and scale them. Then you have to prepare branch metrics. Find your code rate in user manual and program calculation of branch metrics. Next is to setup VCP.
Finally, you have option to receive soft or hard decisions from VCP. If you go for soft decisions (why would you?) then demodulation might be as follows:
int8 soft_decision[ARRAY_SIZE]; // remember to read about alignment
for (i=0; i < count; i++)
{
if (soft_decision[i] < 0) hard_decision = 1;
else hard_decision = 0;
}
Use it as example only. In real application you might need more efficient algorithm. And again, you may opt for hard decision outputs from VCP.
I have corrected the link in previous post, but if you cannot find it again, google on Krishna Sankar Softbit for 16QAM.
rrlagic:
Question1:suppose the data rate is 1/3, in user's guide, the scaling factor is 0.333333, so should I multiply all samples with 0.333333? what if the BPSK modulation is normalized(A = 1)?
Question2:It seems that the demodulation in your example is not soft demodulation because all received samples are determined to be A or -A. I'm puzzled with the term "soft input" in c6474 vcp2 user's guide, in my opinion, the soft input of vcp2 decoder is the output of soft BPSK demoldulation, which should be LLR.
Question3:What we are discussing about BPSK modulation and demodulation does not include adding the carrier,and I want to simulate this process as well.
Greetings,
A1: See VCP manual, it defines:
The branch metrics (BM) are calculated by the DSP and stored in the DSP memory subsystem as 8-bit signed values.
In does not clearly state that BMs are integers, but you should understand that BMs are 8-bit signed integers. If your input data are integers of some other range, scale them to fit within [-42;41]. If your input samples are floating point (normalized A=1 makes sense only in this case), then you have to perform quantization, and again keep samples in [-42;41] range. In this case you multiply by 42 and truncate to integer.
A2: I took it too fast. Ok, lets speak about BPSK. Normally modulated zero looks as (A,0) sample on complex plane. Of course, after channel interference you may receive distorted sample. If your received same (A;0) you are certain that symbol was '0'. Suppose, you received (0.5A:0). Is it '1' or '0'? Probably '0'. If you received (0.1A;0), then still it is '0' but reliability, or likelihood of this value is poor. So (-0.1A;0) is week '1', while (-A0.75;0) is very likely '1'. So, soft decision demodulation of BPSK consists of just measuring the sample, whilst likelihood is proportional to the sample magnitude.
A3: Correct, we are speaking about baseband. I'm sure you can simulate upconversion/downconversion processes too, but you'll have to find your way.
rrlagic:
Thanks for your answer! So the most challenging part in my program is to fulfill BPSK soft demodulation and there are few relevant information of BPSK soft demodulation could be found in the Internet. Could you give me some advice?
I would say BPSK soft decision demodulation is the easiest part of the quest. Again, if your BPSK has its two constellation points on I axis, then BPSK soft decision demodulation is value of I. Literally, value of inphase component is demodulated soft decision value. You don't perform any manipulations and it is already soft decision demodulated bit. Next you want to perform Viterbi decoding, so you have to scale these soft decisions appropriately.
rrlagic:
Thanks for your answer! I think I have got the idea. Recently I am testing the decoding time of VCP2, and I find that it takes much less time decoding soft outputs than decoding hard outputs, how is that and why hard output is prefered?
Greetings,
First, lets clarify the situation. Input to VCP must be branch metrics calculated over soft decisions. You can demodulate hard decisions, then scale them, make branch metrics and send again to VCP, but this way you loose important information about bit quality. So again, I assume you take soft decision demodulated bits, calculate branch metrics and present to VCP.
What I mention before in soft vs hard decisions is type of VCP output. VCP can return either soft decisions or hard decisions. Again, VCP takes soft decisions, but can return either soft decisions or hard decisions. So my comment was about output from VCP. Soft output will give you output together with bits quality. I believe you may need this information if there is next decoding step which relies in bit strength. If no, then I see no reason to request soft output from VCP. Now about savings. Soft output is 8-bit integer, positive values are digital '0' and negative '1'. So, it take you 8 times more memory to store output of VCP. Also, it would take you 8 times more time to output soft decisions.
Now let's find again, what is your situation.