Introduction:
we convert the bit stream to sinusoidal wave and draw the corresponding wave. The activities will be as following.
But we use a PCM decoder which converts the Bit stream to the sinusoidal signal. The procedure is shown by the following figure:
Now describing the code according to the theory:
Step 1: Convert a bit streams to code:
We have a array bits[], which contains bit stream for each code and the each stream is separate by a number i.e. 5. We convert each stream and put each number into an array code1 [] like this:
Step2: code to normalize Quantized value:
Now we use some condition and convert code to normalize Quantized value as following way:
Step 3: normalize Quantized value to normalized PAM value:
Now we add the error value which save previous lab code and then the value is multiple by the Delta value which was Del = (max - min)/ level. Code is as following:
Step 4: draw the wave:
At first we draw the input sine wave then we draw the reconstruct wave to see the error of the output code. We do this as following:
Conclusion:
In above, we discuss how to convert the output of an ADC to the input signal of that ADC. In above code, we use only the integer value to reduce the complicity and we use the sample interval. We use only to level here to reduce the complicity of my code.
we convert the bit stream to sinusoidal wave and draw the corresponding wave. The activities will be as following.
1. We have the bit stream. I convert it to code number.
2. From the code we will get normalize quantized value.
3. We add the error with the normalized quantized value.
4. Then this value will be multiplied by the Delta value which will be normalizing PAM value.
5. Then we will draw the line between two successive point and will get a curve.
But we use a PCM decoder which converts the Bit stream to the sinusoidal signal. The procedure is shown by the following figure:
Now describing the code according to the theory:
Step 1: Convert a bit streams to code:
We have a array bits[], which contains bit stream for each code and the each stream is separate by a number i.e. 5. We convert each stream and put each number into an array code1 [] like this:
Step2: code to normalize Quantized value:
Now we use some condition and convert code to normalize Quantized value as following way:
Step 3: normalize Quantized value to normalized PAM value:
Now we add the error value which save previous lab code and then the value is multiple by the Delta value which was Del = (max - min)/ level. Code is as following:
Step 4: draw the wave:
At first we draw the input sine wave then we draw the reconstruct wave to see the error of the output code. We do this as following:
Conclusion:
In above, we discuss how to convert the output of an ADC to the input signal of that ADC. In above code, we use only the integer value to reduce the complicity and we use the sample interval. We use only to level here to reduce the complicity of my code.
No comments:
Post a Comment