QRSS Rx Network receiver. A receiver to sample a segment of RF spectrum and send this data to a server for further processing and display. NXP mbed Design Challenge entry (Honorable Mention). Published in Circuit Cellar, Feb 2012

Dependencies:   NetServices mbed DNSResolver

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DSP.cpp Source File

DSP.cpp

00001 /*---------------------------------------------------------------------------
00002 
00003     QRSS Receiver Application
00004         
00005     by Clayton ZL3TKA/VK1TKA
00006     clayton@isnotcrazy.com
00007 
00008     DSP Processing class
00009 
00010 ---------------------------------------------------------------------------*/
00011 // include files
00012 
00013 #include "DSP.h"
00014 
00015 // Definitions
00016 
00017 // Macros
00018 
00019 // Local Data
00020 
00021 // Global Data
00022 
00023 // Function Prototypes
00024 
00025 
00026 /*
00027 
00028     LP FIR Filter calculated from Web calculator
00029         http://www-users.cs.york.ac.uk/~fisher/cgi-bin/mkfscript
00030 
00031     Sample Rate:    35156
00032     Corner Freq:    200
00033     Taps:           511
00034     Beta:           0.5
00035 
00036 // Digital filter designed by mkfilter/mkshape/gencode   A.J. Fisher
00037 //  Command line: /www/usr/fisher/helpers/mkshape -c 5.6889293435e-03 5.0000000000e-01 511 -b 16 -l
00038 
00039 #define NZEROS 510
00040 #define GAIN   8.763528442e+01
00041 
00042 static float xv[NZEROS+1];
00043 
00044 static float xcoeffs[] =
00045   { +0.0006713867, +0.0008544922, +0.0010375977, +0.0012817383,
00046     +0.0015258789, +0.0017700195, +0.0020446777, +0.0023498535,
00047     +0.0026855469, +0.0030212402, +0.0033874512, +0.0037841797,
00048     +0.0041809082, +0.0046081543, +0.0050659180, +0.0055236816,
00049     +0.0060119629, +0.0065002441, +0.0070190430, +0.0075378418,
00050     +0.0080871582, +0.0086364746, +0.0092163086, +0.0097961426,
00051     +0.0103759766, +0.0109558105, +0.0115661621, +0.0121765137,
00052     +0.0127868652, +0.0133972168, +0.0140075684, +0.0146179199,
00053     +0.0151977539, +0.0158081055, +0.0163879395, +0.0169677734,
00054     +0.0175476074, +0.0180969238, +0.0186462402, +0.0191650391,
00055     +0.0196533203, +0.0201416016, +0.0205688477, +0.0209960938,
00056     +0.0213928223, +0.0217590332, +0.0220947266, +0.0223693848,
00057     +0.0226440430, +0.0228576660, +0.0230102539, +0.0231323242,
00058     +0.0232238770, +0.0232238770, +0.0232238770, +0.0231323242,
00059     +0.0229797363, +0.0227966309, +0.0225219727, +0.0222167969,
00060     +0.0218200684, +0.0213623047, +0.0208435059, +0.0202636719,
00061     +0.0195922852, +0.0188598633, +0.0180664062, +0.0171813965,
00062     +0.0162048340, +0.0151672363, +0.0140380859, +0.0128479004,
00063     +0.0115661621, +0.0102233887, +0.0087890625, +0.0072631836,
00064     +0.0056762695, +0.0039978027, +0.0022277832, +0.0003967285,
00065     -0.0015258789, -0.0035095215, -0.0055847168, -0.0077514648,
00066     -0.0099792480, -0.0122680664, -0.0146484375, -0.0170898438,
00067     -0.0195922852, -0.0221557617, -0.0248107910, -0.0274963379,
00068     -0.0302429199, -0.0330505371, -0.0359191895, -0.0388183594,
00069     -0.0417785645, -0.0447692871, -0.0477905273, -0.0508422852,
00070     -0.0539245605, -0.0570373535, -0.0601501465, -0.0632934570,
00071     -0.0664367676, -0.0695800781, -0.0727233887, -0.0758666992,
00072     -0.0789794922, -0.0820922852, -0.0851745605, -0.0881958008,
00073     -0.0912170410, -0.0941467285, -0.0970764160, -0.0999145508,
00074     -0.1026916504, -0.1054077148, -0.1080322266, -0.1105651856,
00075     -0.1130065918, -0.1153564453, -0.1175842285, -0.1197204590,
00076     -0.1217346191, -0.1235961914, -0.1253356934, -0.1269226074,
00077     -0.1283569336, -0.1296386719, -0.1307373047, -0.1316833496,
00078     -0.1324462891, -0.1329956055, -0.1333923340, -0.1335754394,
00079     -0.1335144043, -0.1332702637, -0.1328125000, -0.1321105957,
00080     -0.1311950684, -0.1300048828, -0.1286010742, -0.1269226074,
00081     -0.1250000000, -0.1228332519, -0.1203613281, -0.1176452637,
00082     -0.1146545410, -0.1113586426, -0.1077880859, -0.1039428711,
00083     -0.0997924805, -0.0953369141, -0.0906066895, -0.0855407715,
00084     -0.0802001953, -0.0745544434, -0.0686035156, -0.0623168945,
00085     -0.0557250977, -0.0488586426, -0.0416564941, -0.0341186523,
00086     -0.0263061523, -0.0181579590, -0.0097351074, -0.0009765625,
00087     +0.0080871582, +0.0174255371, +0.0270996094, +0.0370483398,
00088     +0.0473022461, +0.0578308105, +0.0686645508, +0.0797729492,
00089     +0.0911560059, +0.1028137207, +0.1147155762, +0.1268920898,
00090     +0.1393432617, +0.1520080566, +0.1649169922, +0.1780700684,
00091     +0.1914367676, +0.2050170898, +0.2188110352, +0.2327880859,
00092     +0.2469482422, +0.2613220215, +0.2758178711, +0.2904968262,
00093     +0.3053283691, +0.3203125000, +0.3353881836, +0.3505859375,
00094     +0.3659057617, +0.3812866211, +0.3967590332, +0.4122924805,
00095     +0.4279174805, +0.4435424805, +0.4591979981, +0.4748840332,
00096     +0.4905700684, +0.5062561035, +0.5219116211, +0.5375366211,
00097     +0.5531005859, +0.5686035156, +0.5840148926, +0.5993652344,
00098     +0.6145935059, +0.6296997070, +0.6446838379, +0.6595153809,
00099     +0.6741943359, +0.6886901855, +0.7030334473, +0.7171325684,
00100     +0.7310485840, +0.7447204590, +0.7581787109, +0.7713623047,
00101     +0.7843017578, +0.7969665527, +0.8093261719, +0.8214111328,
00102     +0.8331604004, +0.8446044922, +0.8557128906, +0.8664855957,
00103     +0.8768920898, +0.8869323730, +0.8966064453, +0.9058837891,
00104     +0.9147949219, +0.9232788086, +0.9313659668, +0.9390258789,
00105     +0.9462585449, +0.9530944824, +0.9594421387, +0.9653625488,
00106     +0.9708557129, +0.9758605957, +0.9804077148, +0.9844970703,
00107     +0.9880981445, +0.9912414551, +0.9938964844, +0.9960937500,
00108     +0.9977722168, +0.9989929199, +0.9997253418, +0.9999694824,
00109     +0.9997253418, +0.9989929199, +0.9977722168, +0.9960937500,
00110     +0.9938964844, +0.9912414551, +0.9880981445, +0.9844970703,
00111     +0.9804077148, +0.9758605957, +0.9708557129, +0.9653625488,
00112     +0.9594421387, +0.9530944824, +0.9462585449, +0.9390258789,
00113     +0.9313659668, +0.9232788086, +0.9147949219, +0.9058837891,
00114     +0.8966064453, +0.8869323730, +0.8768920898, +0.8664855957,
00115     +0.8557128906, +0.8446044922, +0.8331604004, +0.8214111328,
00116     +0.8093261719, +0.7969665527, +0.7843017578, +0.7713623047,
00117     +0.7581787109, +0.7447204590, +0.7310485840, +0.7171325684,
00118     +0.7030334473, +0.6886901855, +0.6741943359, +0.6595153809,
00119     +0.6446838379, +0.6296997070, +0.6145935059, +0.5993652344,
00120     +0.5840148926, +0.5686035156, +0.5531005859, +0.5375366211,
00121     +0.5219116211, +0.5062561035, +0.4905700684, +0.4748840332,
00122     +0.4591979981, +0.4435424805, +0.4279174805, +0.4122924805,
00123     +0.3967590332, +0.3812866211, +0.3659057617, +0.3505859375,
00124     +0.3353881836, +0.3203125000, +0.3053283691, +0.2904968262,
00125     +0.2758178711, +0.2613220215, +0.2469482422, +0.2327880859,
00126     +0.2188110352, +0.2050170898, +0.1914367676, +0.1780700684,
00127     +0.1649169922, +0.1520080566, +0.1393432617, +0.1268920898,
00128     +0.1147155762, +0.1028137207, +0.0911560059, +0.0797729492,
00129     +0.0686645508, +0.0578308105, +0.0473022461, +0.0370483398,
00130     +0.0270996094, +0.0174255371, +0.0080871582, -0.0009765625,
00131     -0.0097351074, -0.0181579590, -0.0263061523, -0.0341186523,
00132     -0.0416564941, -0.0488586426, -0.0557250977, -0.0623168945,
00133     -0.0686035156, -0.0745544434, -0.0802001953, -0.0855407715,
00134     -0.0906066895, -0.0953369141, -0.0997924805, -0.1039428711,
00135     -0.1077880859, -0.1113586426, -0.1146545410, -0.1176452637,
00136     -0.1203613281, -0.1228332519, -0.1250000000, -0.1269226074,
00137     -0.1286010742, -0.1300048828, -0.1311950684, -0.1321105957,
00138     -0.1328125000, -0.1332702637, -0.1335144043, -0.1335754394,
00139     -0.1333923340, -0.1329956055, -0.1324462891, -0.1316833496,
00140     -0.1307373047, -0.1296386719, -0.1283569336, -0.1269226074,
00141     -0.1253356934, -0.1235961914, -0.1217346191, -0.1197204590,
00142     -0.1175842285, -0.1153564453, -0.1130065918, -0.1105651856,
00143     -0.1080322266, -0.1054077148, -0.1026916504, -0.0999145508,
00144     -0.0970764160, -0.0941467285, -0.0912170410, -0.0881958008,
00145     -0.0851745605, -0.0820922852, -0.0789794922, -0.0758666992,
00146     -0.0727233887, -0.0695800781, -0.0664367676, -0.0632934570,
00147     -0.0601501465, -0.0570373535, -0.0539245605, -0.0508422852,
00148     -0.0477905273, -0.0447692871, -0.0417785645, -0.0388183594,
00149     -0.0359191895, -0.0330505371, -0.0302429199, -0.0274963379,
00150     -0.0248107910, -0.0221557617, -0.0195922852, -0.0170898438,
00151     -0.0146484375, -0.0122680664, -0.0099792480, -0.0077514648,
00152     -0.0055847168, -0.0035095215, -0.0015258789, +0.0003967285,
00153     +0.0022277832, +0.0039978027, +0.0056762695, +0.0072631836,
00154     +0.0087890625, +0.0102233887, +0.0115661621, +0.0128479004,
00155     +0.0140380859, +0.0151672363, +0.0162048340, +0.0171813965,
00156     +0.0180664062, +0.0188598633, +0.0195922852, +0.0202636719,
00157     +0.0208435059, +0.0213623047, +0.0218200684, +0.0222167969,
00158     +0.0225219727, +0.0227966309, +0.0229797363, +0.0231323242,
00159     +0.0232238770, +0.0232238770, +0.0232238770, +0.0231323242,
00160     +0.0230102539, +0.0228576660, +0.0226440430, +0.0223693848,
00161     +0.0220947266, +0.0217590332, +0.0213928223, +0.0209960938,
00162     +0.0205688477, +0.0201416016, +0.0196533203, +0.0191650391,
00163     +0.0186462402, +0.0180969238, +0.0175476074, +0.0169677734,
00164     +0.0163879395, +0.0158081055, +0.0151977539, +0.0146179199,
00165     +0.0140075684, +0.0133972168, +0.0127868652, +0.0121765137,
00166     +0.0115661621, +0.0109558105, +0.0103759766, +0.0097961426,
00167     +0.0092163086, +0.0086364746, +0.0080871582, +0.0075378418,
00168     +0.0070190430, +0.0065002441, +0.0060119629, +0.0055236816,
00169     +0.0050659180, +0.0046081543, +0.0041809082, +0.0037841797,
00170     +0.0033874512, +0.0030212402, +0.0026855469, +0.0023498535,
00171     +0.0020446777, +0.0017700195, +0.0015258789, +0.0012817383,
00172     +0.0010375977, +0.0008544922, +0.0006713867,
00173   };
00174 
00175 static void filterloop()
00176   { for (;;)
00177       { float sum; int i;
00178         for (i = 0; i < NZEROS; i++) xv[i] = xv[i+1];
00179         xv[NZEROS] = next input value / GAIN;
00180         sum = 0.0;
00181         for (i = 0; i <= NZEROS; i++) sum += (xcoeffs[i] * xv[i]);
00182         next output value = sum;
00183       }
00184   }
00185 
00186 */
00187 
00188 const int16_t aiFIRCoefficients[DSP_FIR_COEFFICIENTS] = {
00189         22,28,34,42,50,58,67,77,
00190         88,99,111,124,137,151,166,181,
00191         197,213,230,247,265,283,302,321,
00192         340,359,379,399,419,439,459,479,
00193         498,518,537,556,575,593,611,628,
00194         644,660,674,688,701,713,724,733,
00195         742,749,754,758,761,761,761,758,
00196         753,747,738,728,715,700,683,664,
00197         642,618,592,563,531,497,460,421,
00198         379,335,288,238,186,131,73,13,
00199         -50,-115,-183,-254,-327,-402,-480,-560,
00200         -642,-726,-813,-901,-991,-1083,-1177,-1272,
00201         -1369,-1467,-1566,-1666,-1767,-1869,-1971,-2074,
00202         -2177,-2280,-2383,-2486,-2588,-2690,-2791,-2890,
00203         -2989,-3085,-3181,-3274,-3365,-3454,-3540,-3623,
00204         -3703,-3780,-3853,-3923,-3989,-4050,-4107,-4159,
00205         -4206,-4248,-4284,-4315,-4340,-4358,-4371,-4377,
00206         -4375,-4367,-4352,-4329,-4299,-4260,-4214,-4159,
00207         -4096,-4025,-3944,-3855,-3757,-3649,-3532,-3406,
00208         -3270,-3124,-2969,-2803,-2628,-2443,-2248,-2042,
00209         -1826,-1601,-1365,-1118,-862,-595,-319,-32,
00210         265,571,888,1214,1550,1895,2250,2614,
00211         2987,3369,3759,4158,4566,4981,5404,5835,
00212         6273,6718,7170,7628,8092,8563,9038,9519,
00213         10005,10496,10990,11488,11990,12494,13001,13510,
00214         14022,14534,15047,15561,16075,16589,17102,17614,
00215         18124,18632,19137,19640,20139,20634,21125,21611,
00216         22092,22567,23037,23499,23955,24403,24844,25276,
00217         25700,26115,26520,26916,27301,27676,28040,28393,
00218         28734,29063,29380,29684,29976,30254,30519,30770,
00219         31007,31231,31439,31633,31813,31977,32126,32260,
00220         32378,32481,32568,32640,32695,32735,32759,32767,
00221         32759,32735,32695,32640,32568,32481,32378,32260,
00222         32126,31977,31813,31633,31439,31231,31007,30770,
00223         30519,30254,29976,29684,29380,29063,28734,28393,
00224         28040,27676,27301,26916,26520,26115,25700,25276,
00225         24844,24403,23955,23499,23037,22567,22092,21611,
00226         21125,20634,20139,19640,19137,18632,18124,17614,
00227         17102,16589,16075,15561,15047,14534,14022,13510,
00228         13001,12494,11990,11488,10990,10496,10005,9519,
00229         9038,8563,8092,7628,7170,6718,6273,5835,
00230         5404,4981,4566,4158,3759,3369,2987,2614,
00231         2250,1895,1550,1214,888,571,265,-32,
00232         -319,-595,-862,-1118,-1365,-1601,-1826,-2042,
00233         -2248,-2443,-2628,-2803,-2969,-3124,-3270,-3406,
00234         -3532,-3649,-3757,-3855,-3944,-4025,-4096,-4159,
00235         -4214,-4260,-4299,-4329,-4352,-4367,-4375,-4377,
00236         -4371,-4358,-4340,-4315,-4284,-4248,-4206,-4159,
00237         -4107,-4050,-3989,-3923,-3853,-3780,-3703,-3623,
00238         -3540,-3454,-3365,-3274,-3181,-3085,-2989,-2890,
00239         -2791,-2690,-2588,-2486,-2383,-2280,-2177,-2074,
00240         -1971,-1869,-1767,-1666,-1566,-1467,-1369,-1272,
00241         -1177,-1083,-991,-901,-813,-726,-642,-560,
00242         -480,-402,-327,-254,-183,-115,-50,13,
00243         73,131,186,238,288,335,379,421,
00244         460,497,531,563,592,618,642,664,
00245         683,700,715,728,738,747,753,758,
00246         761,761,761,758,754,749,742,733,
00247         724,713,701,688,674,660,644,628,
00248         611,593,575,556,537,518,498,479,
00249         459,439,419,399,379,359,340,321,
00250         302,283,265,247,230,213,197,181,
00251         166,151,137,124,111,99,88,77,
00252         67,58,50,42,34,28,22
00253         };
00254 
00255 /*
00256     Sin table to convert NCO phase to Oscillator outputs
00257 */
00258 const int16_t aiSinTable[256] = {
00259         0,6,13,19,25,31,37,44,
00260         50,56,62,68,74,80,86,92,
00261         98,103,109,115,120,126,131,136,
00262         142,147,152,157,162,167,171,176,
00263         180,185,189,193,197,201,205,208,
00264         212,215,219,222,225,228,231,233,
00265         236,238,240,242,244,246,247,249,
00266         250,251,252,253,254,254,255,255,
00267         255,255,255,254,254,253,252,251,
00268         250,249,247,246,244,242,240,238,
00269         236,233,231,228,225,222,219,215,
00270         212,208,205,201,197,193,189,185,
00271         180,176,171,167,162,157,152,147,
00272         142,136,131,126,120,115,109,103,
00273         98,92,86,80,74,68,62,56,
00274         50,44,37,31,25,19,13,6,
00275         0,-6,-13,-19,-25,-31,-37,-44,
00276         -50,-56,-62,-68,-74,-80,-86,-92,
00277         -98,-103,-109,-115,-120,-126,-131,-136,
00278         -142,-147,-152,-157,-162,-167,-171,-176,
00279         -180,-185,-189,-193,-197,-201,-205,-208,
00280         -212,-215,-219,-222,-225,-228,-231,-233,
00281         -236,-238,-240,-242,-244,-246,-247,-249,
00282         -250,-251,-252,-253,-254,-254,-255,-255,
00283         -255,-255,-255,-254,-254,-253,-252,-251,
00284         -250,-249,-247,-246,-244,-242,-240,-238,
00285         -236,-233,-231,-228,-225,-222,-219,-215,
00286         -212,-208,-205,-201,-197,-193,-189,-185,
00287         -180,-176,-171,-167,-162,-157,-152,-147,
00288         -142,-136,-131,-126,-120,-115,-109,-103,
00289         -98,-92,-86,-80,-74,-68,-62,-56,
00290         -50,-44,-37,-31,-25,-19,-13,-6 
00291         };
00292 
00293 //---------------------------------------------------------------------------
00294 //  LOCAL FUNCTIONS
00295 //---------------------------------------------------------------------------
00296 
00297 //---------------------------------------------------------------------------
00298 //
00299 //  Perform a MAC Operation (multiply and Accumulate)
00300 //      Assumes data is from samples structure, so skips every 2nd sample
00301 //      Produces a 64 bit result
00302 //
00303 int64_t MAC_Samples( int64_t llSum, const int32_t *piSamples, const int16_t *piCoefficients, int iCnt )
00304 {
00305     int64_t llMult;
00306     
00307     while ( iCnt>0 )
00308     {
00309         llMult = *piSamples;
00310         llMult *= *piCoefficients;
00311         llSum += llMult;
00312         piSamples++;
00313         piSamples++;    // skip other sample pair
00314         piCoefficients++;
00315         iCnt--;
00316     }
00317     return llSum;
00318 }
00319 
00320 //---------------------------------------------------------------------------
00321 //
00322 //  Convert a 64 bit sum to a 32 bit output
00323 //
00324 int32_t ConvertToOutput( int64_t llSum )
00325 {
00326     return (int32_t)(llSum>>FIR_SHIFT_FACTOR);
00327 }
00328 
00329 //---------------------------------------------------------------------------
00330 //  DSP Methods
00331 //---------------------------------------------------------------------------
00332 
00333 //---------------------------------------------------------------------------
00334 //
00335 //  Set up NCO Increment from a frequency value
00336 //
00337 void TDSPProcessor::NCOFrequency( int32_t iFreq )
00338 {
00339     int64_t     llFreq;
00340     int64_t     llInc;
00341 
00342     // Inc (32bit) = Freq * 2^32 / SampleRate
00343     // Use long long (64 bit int) for calculations to prevent overflow and get best resolution
00344     llFreq = iFreq;
00345     llInc = llFreq * 0x10000 * 0x10000 / SAMPLE_RATE;
00346     // Convert back to 32 bit unsigned via integer type
00347     uiMixerPhaseIncrement = (uint32_t)((int32_t)llInc);
00348     printf( "LO Freq set to %d - NCO Inc set to %u\r\n", iFreq, uiMixerPhaseIncrement );
00349 }
00350 
00351 
00352 //---------------------------------------------------------------------------
00353 //
00354 //  Reset processing
00355 //
00356 void TDSPProcessor::Reset()
00357 {
00358     uiMixerPhaseAccumulator = 0;
00359     bLPFPartailsValid = false;
00360     Release();
00361 }
00362 
00363 //---------------------------------------------------------------------------
00364 //
00365 //  Mix samples with LO (local oscillator)
00366 //
00367 bool TDSPProcessor::MixLO()
00368 {
00369     int ii;
00370     int iLen = Length();
00371     TDataSample * pSample;
00372     int16_t     iIlo;
00373     int16_t     iQlo;
00374     int32_t     iIin;
00375     int32_t     iQin;
00376 
00377     for ( ii=0,pSample=SamplePtr(); ii<iLen; ii++,pSample++ )
00378     {
00379         // generate quadrature oscillators. LO I=cos Q=sin
00380         iIlo = aiSinTable[ (64+(uiMixerPhaseAccumulator>>24))&0xFF ];     // COS
00381         iQlo = aiSinTable[ (uiMixerPhaseAccumulator>>24) ];               // SIN
00382         // inc NCO
00383         uiMixerPhaseAccumulator += uiMixerPhaseIncrement;
00384         // scale samples (they are only 24 bits)
00385         iIin = pSample->iIData / 256;
00386         iQin = pSample->iQData / 256;
00387         // complex multiply sample and LO
00388         // (A + Bi) * (C + Di) = (AC - BD) + (BC + AD)i
00389         pSample->iIData = (iIin * iIlo) - (iQin * iQlo);
00390         pSample->iQData = (iQin * iIlo) + (iIin * iQlo);
00391     }
00392 
00393     return true;
00394 }
00395 
00396 //---------------------------------------------------------------------------
00397 //
00398 //  LPF processing
00399 //
00400 bool TDSPProcessor::LPF()
00401 {
00402 /*
00403     We just code this up for the parameters defined.
00404     It could be dynamically coded, but for simplicity hard-coding will be used
00405 */
00406 #if (BUFFERSYS_SIZE!=512)
00407   #error BUFFERSYS_SIZE has changed from 512
00408 #endif
00409 #if (DSP_FIR_COEFFICIENTS!=511)
00410   #error DSP_FIR_COEFFICIENTS has changed from 511
00411 #endif
00412 #if (DECIMATION_RATIO!=64)
00413   #error DECIMATION_RATIO has changed from 64
00414 #endif
00415 #if (LPF_OUTPUTS_SIZE!=8)
00416   #error LPF_OUTPUTS_SIZE has changed from 8
00417 #endif
00418 
00419     int64_t     iSum;
00420     int         ii;
00421     bool        bRet = false;
00422 
00423     // Outputs
00424     if ( bLPFPartailsValid )
00425     {
00426         for ( ii=0; ii<8; ii++ )
00427         {
00428             iSum = MAC_Samples( asLPFPartials[ii].iIData, &(SamplePtr(0)->iIData), &(aiFIRCoefficients[448-(ii*64)]), (ii*64)+62 );
00429             asLPFOutputs[ii].iIData = ConvertToOutput( iSum );
00430             iSum = MAC_Samples( asLPFPartials[ii].iQData, &(SamplePtr(0)->iQData), &(aiFIRCoefficients[448-(ii*64)]), (ii*64)+62 );
00431             asLPFOutputs[ii].iQData = ConvertToOutput( iSum );
00432         }
00433         bRet = true;
00434     }
00435     // Partials
00436     for ( ii=0; ii<7; ii++ )
00437     {
00438         asLPFPartials[ii].iIData = MAC_Samples( 0, &(SamplePtr((ii*64)+64)->iIData), &(aiFIRCoefficients[0]), (7-ii)*64 );
00439         asLPFPartials[ii].iQData = MAC_Samples( 0, &(SamplePtr((ii*64)+64)->iQData), &(aiFIRCoefficients[0]), (7-ii)*64 );
00440     }
00441     // Partials[7] = 0
00442     asLPFPartials[7].iIData = 0;
00443     asLPFPartials[7].iQData = 0;
00444     bLPFPartailsValid = true;
00445 
00446     return bRet;
00447 }
00448 
00449 //---------------------------------------------------------------------------
00450 //  END
00451 //---------------------------------------------------------------------------