Вот один (+)
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено SM 12 июля 2004 г. 10:46
В ответ на: Крик души отправлено sda 12 июля 2004 г. 09:43


/* VITERBI V32 PSTN TRELLIS DECODER
*
* Revision Date: 06/18/97
*
* USAGE This routine is C callable and can be called as
*
* short vitv32(short old[], short next[], short d[])
*
* old --- state metrics at previous instant (input)
* next --- state metrics at current instant (output)
* d --- computed Euclidean distances between (input)
* input data and closest points in the
* constellation
*
*
* short vitv32(short old[], short next[], short d[])
* {
* int i, j, k;
* int a, max, path, index;
* int tr = 0;
* for (i = 0; i < 2; i++) {
* for (j = 0; j < 4; j++) {
* max = old[i * 4] - d[i * 4 + j % 4];
* path = 0;
* index = j;
* for (k = 1; k < 4; k++) {
* index = -index;
* a = old[k + i * 4] - d[i*4 + (4+k+index) % 4];
* if (a > max) {
* max = a;
* path = k;
* }
* }
* next[j * 2 + i] = max;
* tr = tr << 2 | path;
* }
* }
* return tr;
* }
*
* DESCRIPTION
*
* This routine implements one stage of Viterbi V32 trellis
* decoder based on soft-decision Viterbi decoding technique.
* The code is of rate 2/3 and of constraint lenght K = 4.
*
* Current metrics are computed by subtracting the Euclidean
* distance from the old state metrics. The new metric with
* the maximum value will have the shortest distance and the
* most likely path for the output. The path taken will be
* return value of the function.
*
* ASSUMPTIONS
* 1. Rate -> 2/3
* 2. K = 4
*/


Составить ответ  |||  Конференция  |||  Архив

Ответы



Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru