qpsk解调.txt
上传用户:ljj2288
上传日期:2013-05-04
资源大小:5k
文件大小:8k
源码类别:

邮电通讯系统

开发平台:

C/C++

  1. qpsk解调的DSP实现
  2. 参数设定:采样速率384000次/S
  3.           载波频率48KHZ
  4.           传输数据速率64Kb/s
  5.           汉明窗平方根升余弦滚降
  6.           滚降系数0.35
  7.           51阶FIR滤波
  8. 子程序说明
  9.    PSK_demod 子程序用来对接收信号进行波形成型和低通根升余弦特性的滤波。
  10.    sin_val子程序用线性内插法提高正,余弦值的精度
  11. 输入输出
  12.    程序从A/D缓冲区读入16b数据。
  13.    经过处理后,数据输出至RW_BUFR和RW_BUFI缓冲区,形成为16b数据
  14. 符号设定
  15.   RW_FILR.set 500H
  16.   RW_FILI  .set 600H
  17.   RW_BUFR .set 700H
  18.   RW_BUFI.set 900H
  19.   RW_ADB .set 6000H
  20.   RW_FILL.set 51H
  21.   RW_BUFL .set 51H
  22.   RW_ADBL .set 800H
  23.   RW_BUFIN存放RW_BUFR和RW_BUFI的入口地址
  24.   RW_BUFOUT存放RW_BUFR和RW_BUFI的出口地址
  25.   RW_ADIN存放RW_ADB的入口地址
  26.   RW_ADOUT存放RW_ADB的出口地址
  27.   SIN_RP存放表sin_tab_512的读取点位置
  28. 主要部分程序:
  29.   psk_demod
  30.      LD RW_ADIN,A;将A/D缓冲的入口放到A中
  31.      SUB RW_ADOUT,A;求A/D缓冲区的入口和出口之差
  32.      NOP 
  33.      NOP
  34.      XC 2,ALT
  35.      ADD #RW_ADBL,A
  36.      SUB #8,A
  37.      BC rw_demod00,ALET;检查A/D缓冲区中是否有采样值要解调
  38.      LD RW_BUFOUT,A
  39.      SUB RW_BUFIN,A
  40.      NOP
  41.      NOP
  42.      XC,2,ALEQ
  43.      ADD #200H,A
  44.      SUB #24H,A
  45.      BC rw_demod00,ALT;检查RW_BUFR和RW_BUFI是否有空间
  46.      LD #RW_BUFR,A
  47.      ADD RW_BUFIN,A;计算RW_BUFR的入口地址
  48.      STLM A,AR1
  49.      LD #RW_BUFI,A
  50.      ADD RW_BUFIN,A;计算RW_BUFI的入口地址
  51.      STLM A,AR2
  52.      LD RW_ADOUT,A
  53.      ADD #RW_ADB,A;计算RW_ADB的出口地址
  54.      STLM A,AR3
  55.      STM #50,AR0 ;循环51次
  56.      STM #7,BRC
  57.      RPTBD rw_dem01-1;循环下界到rw_dem01之前
  58.      STM #RW_ADBL,BK
  59.      SSBX FRCT
  60.      STM #FILR,AR4
  61.      STM #FILI,AR5
  62.      CALL sin_val;计算正,余弦值
  63.      LD *AR3+%,T
  64.      MPY DATA5,A
  65.      STH A,*AR4+0
  66.      MPY DATA6,A
  67.      STH A,*AR5+0
  68.      RSBX FRCT
  69.      RPTZ A,#50
  70.      MACD *AR4-,scr_wave,A;R(t)信号进行FIR滤波
  71.      STH A,*AR1+
  72.      RPTZ A,#50
  73.      MACD *AR5-,scr_wave,A;I(t)信号进行FIR滤波
  74.      STH A,*AR2+
  75. rw_demo01
  76.     SSBX FRCT
  77.     LD SR_BUFIN,A;改变RW_BUFR的入口地址
  78.     ADD #08H,A
  79.     AND #1FFH,A
  80.     STL A,RW_BUFIN
  81.     LD RW_ADOUT,A;改变A/D缓冲区的出口地址
  82.     ADD #08H,A
  83.     AND #RW_ADBL-1,A
  84.     STL A,RW_ADOUT
  85. rw_demo00
  86.     RET
  87. sin_val
  88.     LD SIN_RP,A
  89.     AND #3FH,A
  90.     STL A,DATA0
  91.     LD DATA0,9,A
  92.     STL A,DATA0;取低6b
  93.     LD SIN_RP,10,A
  94.     STH A,DATA1;取高9b
  95.     LD DATA1,A
  96.     ADD #sin_tab_512,A
  97.     READA DATA2;第一个数据D1
  98.     ADD #1,A
  99.     READA DATA3;第2个数据D2
  100.     LD DATA3,A
  101.     SUB DATA2,A;D1-D2
  102.     STL A,DATA4
  103.     LD DATA0,T
  104.     MPY DATA4,A
  105.     ADD DATA2,16,A
  106.     STH A,DATA5;正弦值(D1-D2)*xxxxxxB
  107.     LD DATA1,A
  108.     ADD #80,A
  109.     AND #1FFH,A
  110.     ADD #sin_tab_512,A
  111.     READA DATA2;第一个数据D3
  112.     ADD #1,A
  113.     READA DATA3;第2个数据D4
  114.     LD DATA3,A
  115.     SUB DATA2,A;D3-D4
  116.     STL A,DATA4
  117.     MPY DATA4,A
  118.     ADD DATA2,16,A
  119.     STH A,DATA6;余弦值(D3-D4)*xxxxxxB
  120.     LD SIN_CH,A
  121.     ADD #SIN_RP,A;修改sin_tab_512读入地址
  122.     ADD #DEG45,A
  123.     NOP
  124.     NOP
  125.    XC 2,ALT
  126.    ADD #8000H,A
  127.    AND #7FFFH,A
  128.    STL A,SIN_RP;保存修改后的地址
  129.    RET
  130. scr_wave ;滚降系数为0.35的根升余弦表
  131.    .word 0fff6H,00003H,00013H,0001eH,00019H,0fffaH,0ffc1H,0ff89H,0ff85H
  132.    .word 0ffe8H,000c2H,001dcH,002a9H,0026aH,00087H,0fcf9H,0f89cH,0f53cH
  133.    .word 0f52aH,0fa7eH,00633H,01781H,02bb9H,03ed2H,04c7dH,05174H,04c7dH
  134.    .word 03ed2H,02bb9H,01781H,00633H,0fa7eH,0f52aH,0f53cH,0f89cH,0fcf9H
  135.    .word 00087H,0026aH,002a9H,001dcH,000c2H,0ffe8H,0ff85H,0ff89H,0ffc1H
  136.    .word 0fffaH,00019H,0001eH,00013H,00003H,0fff6H
  137. sin_tab_512;512点正弦值
  138.    .word 00000H,00192H,00324H,004b6H,00647H,007d9H,0096aH,00afbH,00c8bH
  139.    .word 00e1bH,00fabH,01139H,012c8H,01455H,015e2H,0176dH,018f8H,01a82H
  140.    .word 01c0bH,01d39H,01f19H,0209fH,02223H,023a6H,02528H,026a8H,02826H
  141.    .word 029a3H,02b1fH,02c98H,02e11H,02f87H,030fbH,0326eH,033deH,0354dH
  142.    .word 036baH,03824H,0398cH,03af2H,03c56H,03db8H,03f17H,04073H,041ceH   
  143.    .word 04325H,0447aH,045cdH,0417cH,04869H,049b4H,04afbH,04c3fH,04d81H
  144.    .word 04ebfH,04ffbH,05133H,05269H,0539bH,054caH,055f5H,0571dH,05842H
  145.    .word 05964H,05a82H,05b9dH,05cb4H,05dc7H,05ed7H,05fe3H,060ecH,061f1H
  146.    .word 062f2H,063efH,064e8H,065ddH,066cfH,067bdH,068a6H,0698cH,06a6dH
  147.    .word 06b4aH,06c24H,06cf9H,06dcaH,06e96H,06f5fH,07023H,070e2H,0719eH   
  148.    .word 07255H,07307H,073b5H,0745fH,07504H,075a5H,07641H,076d9H,0776cH
  149.    .word 077faH,07884H,07909H,0798aH,07a05H,07a7dH,07aefH,07b5dH,07bc5H
  150.    .word 07c29H,07c89H,07ce3H,07d39H,07d8aH,07dd6H,07e1dH,07e5fH,07e9dH
  151.    .word 07ed5H,07f09H,07f38H,07f62H,07f87H,07fa7H,07fc2H,07fd8H,07fe9H
  152.    .word 07ff6H,07ffdH,07fffH,07ffdH,07ff6H,07fe9H,07fd8H,07fc2H,07fa7H  
  153.    .word 07f87H,07f62H,07f38H,07f09H,07ed5H,07e9dH,07e5fH,07e1dH,07dd6H
  154.    .word 07d8aH,07d39H,07ce3H,07c89H,07c29H,07bc5H,07b5dH,07aefH,07a7dH
  155.    .word 07a05H,0798aH,07909H,07884H,077faH,0776cH,076d9H,07641H,075a5H
  156.    .word 07504H,0745fH,073b5H,07307H,07255H,0719eH,070e2H,07023H,06f5fH
  157.    .word 06e96H,06dcaH,06cf9H,06c24H,06b4aH,06a6dH,0698cH,068a6H,067bdH
  158.    .word 066cfH,065ddH,064e8H,063efH,062f2H,061f1H,060ecH,05fe3H,05ed7H
  159.    .word 05dc7H,05cb4H,05b9dH,05a82H,05964H,05842H,0571dH,055f5H,054caH
  160.    .word 0539bH,05269H,05133H,04ffbH,04ebfH,04d81H,04c3fH,04afbH,049b4H
  161.    .word 04869H,0471cH,045cdH,0447aH,04325H,041ceH,04073H,03f17H,03db8H
  162.    .word 03c56H,03af2H,0398cH,03824H,036baH,0354dH,033deH,0326eH,030fbH
  163.    .word 02f87H,02e11H,02c98H,02b1fH,029a3H,02826H,026a8H,02528H,023a6H
  164.    .word 02223H,0209fH,01f19H,01d93H,01c0bH,01a82H,018f8H,0176dH,015e2H
  165.    .word 01455H,012c8H,01139H,00fabH,00e1bH,00c8bH,00afbH,0096aH,007d9H
  166.    .word 00647H,004b6H,00324H,00192H,00000H,0fe6eH,0fcdcH,0fb4aH,0F9b9H
  167.    .word 0f827H,0f696H,0f505H,0f375H,0f1e5H,0f055H,0eec7H,0ed38H,0ebabH
  168.    .word 0ea1eH,0e893H,0e708H,0e57eH,0e3f5H,0e26dH,0e0e7H,0df61H,0ddddH
  169.    .word 0dc5aH,0dad8H,0d958H,0d7daH,0d65dH,0d4e1H,0d368H,0d1efH,0d079H
  170.    .word 0cf05H,0cd92H,0cc22H,0cab3H,0c946H,0c7dcH,0c674H,0c50eH,0c3aaH
  171.    .word 0c248H,0c0e9H,0bf8dH,0be32H,0bcdbH,0bb86H,0ba33H,0b8e4H,0b797H
  172.    .word 0b64cH,0b505H,0b3c1H,0b27fH,0b141H,0b005H,0aecdH,0ad97H,0ac65H
  173.    .word 0ab36H,0aa0bH,0a8e3H,0a7beH,0a69cH,0a57eH,0a463H,0a34cH,0a239H
  174.    .word 0a129H,0a01dH,09f14H,09e10H,09d0eH,09c11H,09b18H,09a23H,09931H
  175.    .word 09843H,0975aH,09674H,09593H,094b6H,093dcH,09307H,09236H,0916aH
  176.    .word 090a1H,08fddH,08f1eH,08e62H,08dabH,08cf9H,08c4bH,08ba1H,08afcH
  177.    .word 08a5bH,089bfH,08927H,08894H,08806H,0877cH,086f7H,08676H,085fbH
  178.    .word 08583H,08511H,084a3H,0843bH,083d7H,08377H,0831dH,082c7H,08276H
  179.    .word 0822aH,081e3H,081a1H,08163H,0812bH,080f7H,080c8H,0809eH,08079H
  180.    .word 08059H,0803eH,08028H,08017H,0800aH,08003H,08001H,08003H,0800aH
  181.    .word 08017H,08028H,0803eH,08059H,08079H,0809eH,080c8H,080f7H,0812bH
  182.    .word 08163H,081a1H,081e3H,0822aH,08276H,082C7H,0831dH,08377H,083d7H
  183.    .word 0843bH,084a3H,08511H,08583H,085fbH,08676H,086f7H,0877cH,08806H
  184.    .word 08894H,08927H,089bfH,08a5bH,08afcH,08ba1H,08c4bH,08c4bH,08dabH
  185.    .word 08e62H,08f1eH,08fddH,090a1H,0916aH,09236H,09307H,093dcH,094b6H
  186.    .word 09593H,09674H,0975aH,09843H,09931H,09a23H,09b18H,09c11H,09d0eH
  187.    .word 09e0fH,09f14H,0a01dH,0a129H,0a239H,0a34cH,0a463H,0a57eH,0a69cH
  188.    .word 0a7beH,0a8e3H,0aa0bH,0ab36H,0ac65H,0ad97H,0aecdH,0b005H,0b141H
  189.    .word 0b27fH,0b3c1H,0b505h,0b64cH,0b797H,0b8e4H,0ba33H,0bb86H,0bcdbH
  190.    .word 0be32H,0bf8dH,0c0e9H,0c248H,0c3aaH,0c50eH,0c674H,0c7dcH,0c946H
  191.    .word 0cab3H,0cc22H,0cd92H,0cf05H,0d079H,0d1efH,0d368H,0d4e1H,0d65dH
  192.    .word 0d7daH,0d958H,0dad8H,0dc5aH,0ddddH,0df61H,0e0e7H,0e26dH,0e3f5H
  193.    .word 0e57eH,0e708H,0e893H,0ea1eH,0ebabH,0ed38H,0eec7H,0f055h,0f1e5H
  194.    .word 0f375H,0f505H,0f696H,0f827H,0f9b9H,0fb4aH,0fcdcH,0fe6eH
  195.