qpsk解调.txt
上传用户:ljj2288
上传日期:2013-05-04
资源大小:5k
文件大小:8k
- qpsk解调的DSP实现
- 参数设定:采样速率384000次/S
- 载波频率48KHZ
- 传输数据速率64Kb/s
- 汉明窗平方根升余弦滚降
- 滚降系数0.35
- 51阶FIR滤波
- 子程序说明
- PSK_demod 子程序用来对接收信号进行波形成型和低通根升余弦特性的滤波。
- sin_val子程序用线性内插法提高正,余弦值的精度
- 输入输出
- 程序从A/D缓冲区读入16b数据。
- 经过处理后,数据输出至RW_BUFR和RW_BUFI缓冲区,形成为16b数据
- 符号设定
- RW_FILR.set 500H
- RW_FILI .set 600H
- RW_BUFR .set 700H
- RW_BUFI.set 900H
- RW_ADB .set 6000H
- RW_FILL.set 51H
- RW_BUFL .set 51H
- RW_ADBL .set 800H
- RW_BUFIN存放RW_BUFR和RW_BUFI的入口地址
- RW_BUFOUT存放RW_BUFR和RW_BUFI的出口地址
- RW_ADIN存放RW_ADB的入口地址
- RW_ADOUT存放RW_ADB的出口地址
- SIN_RP存放表sin_tab_512的读取点位置
- 主要部分程序:
- psk_demod
- LD RW_ADIN,A;将A/D缓冲的入口放到A中
- SUB RW_ADOUT,A;求A/D缓冲区的入口和出口之差
- NOP
- NOP
- XC 2,ALT
- ADD #RW_ADBL,A
- SUB #8,A
- BC rw_demod00,ALET;检查A/D缓冲区中是否有采样值要解调
- LD RW_BUFOUT,A
- SUB RW_BUFIN,A
- NOP
- NOP
- XC,2,ALEQ
- ADD #200H,A
- SUB #24H,A
- BC rw_demod00,ALT;检查RW_BUFR和RW_BUFI是否有空间
- LD #RW_BUFR,A
- ADD RW_BUFIN,A;计算RW_BUFR的入口地址
- STLM A,AR1
- LD #RW_BUFI,A
- ADD RW_BUFIN,A;计算RW_BUFI的入口地址
- STLM A,AR2
- LD RW_ADOUT,A
- ADD #RW_ADB,A;计算RW_ADB的出口地址
- STLM A,AR3
- STM #50,AR0 ;循环51次
- STM #7,BRC
- RPTBD rw_dem01-1;循环下界到rw_dem01之前
- STM #RW_ADBL,BK
- SSBX FRCT
- STM #FILR,AR4
- STM #FILI,AR5
- CALL sin_val;计算正,余弦值
- LD *AR3+%,T
- MPY DATA5,A
- STH A,*AR4+0
- MPY DATA6,A
- STH A,*AR5+0
- RSBX FRCT
- RPTZ A,#50
- MACD *AR4-,scr_wave,A;R(t)信号进行FIR滤波
- STH A,*AR1+
- RPTZ A,#50
- MACD *AR5-,scr_wave,A;I(t)信号进行FIR滤波
- STH A,*AR2+
- rw_demo01
- SSBX FRCT
- LD SR_BUFIN,A;改变RW_BUFR的入口地址
- ADD #08H,A
- AND #1FFH,A
- STL A,RW_BUFIN
- LD RW_ADOUT,A;改变A/D缓冲区的出口地址
- ADD #08H,A
- AND #RW_ADBL-1,A
- STL A,RW_ADOUT
- rw_demo00
- RET
- sin_val
- LD SIN_RP,A
- AND #3FH,A
- STL A,DATA0
- LD DATA0,9,A
- STL A,DATA0;取低6b
- LD SIN_RP,10,A
- STH A,DATA1;取高9b
- LD DATA1,A
- ADD #sin_tab_512,A
- READA DATA2;第一个数据D1
- ADD #1,A
- READA DATA3;第2个数据D2
- LD DATA3,A
- SUB DATA2,A;D1-D2
- STL A,DATA4
- LD DATA0,T
- MPY DATA4,A
- ADD DATA2,16,A
- STH A,DATA5;正弦值(D1-D2)*xxxxxxB
- LD DATA1,A
- ADD #80,A
- AND #1FFH,A
- ADD #sin_tab_512,A
- READA DATA2;第一个数据D3
- ADD #1,A
- READA DATA3;第2个数据D4
- LD DATA3,A
- SUB DATA2,A;D3-D4
- STL A,DATA4
- MPY DATA4,A
- ADD DATA2,16,A
- STH A,DATA6;余弦值(D3-D4)*xxxxxxB
- LD SIN_CH,A
- ADD #SIN_RP,A;修改sin_tab_512读入地址
- ADD #DEG45,A
- NOP
- NOP
- XC 2,ALT
- ADD #8000H,A
- AND #7FFFH,A
- STL A,SIN_RP;保存修改后的地址
- RET
- scr_wave ;滚降系数为0.35的根升余弦表
- .word 0fff6H,00003H,00013H,0001eH,00019H,0fffaH,0ffc1H,0ff89H,0ff85H
- .word 0ffe8H,000c2H,001dcH,002a9H,0026aH,00087H,0fcf9H,0f89cH,0f53cH
- .word 0f52aH,0fa7eH,00633H,01781H,02bb9H,03ed2H,04c7dH,05174H,04c7dH
- .word 03ed2H,02bb9H,01781H,00633H,0fa7eH,0f52aH,0f53cH,0f89cH,0fcf9H
- .word 00087H,0026aH,002a9H,001dcH,000c2H,0ffe8H,0ff85H,0ff89H,0ffc1H
- .word 0fffaH,00019H,0001eH,00013H,00003H,0fff6H
- sin_tab_512;512点正弦值
- .word 00000H,00192H,00324H,004b6H,00647H,007d9H,0096aH,00afbH,00c8bH
- .word 00e1bH,00fabH,01139H,012c8H,01455H,015e2H,0176dH,018f8H,01a82H
- .word 01c0bH,01d39H,01f19H,0209fH,02223H,023a6H,02528H,026a8H,02826H
- .word 029a3H,02b1fH,02c98H,02e11H,02f87H,030fbH,0326eH,033deH,0354dH
- .word 036baH,03824H,0398cH,03af2H,03c56H,03db8H,03f17H,04073H,041ceH
- .word 04325H,0447aH,045cdH,0417cH,04869H,049b4H,04afbH,04c3fH,04d81H
- .word 04ebfH,04ffbH,05133H,05269H,0539bH,054caH,055f5H,0571dH,05842H
- .word 05964H,05a82H,05b9dH,05cb4H,05dc7H,05ed7H,05fe3H,060ecH,061f1H
- .word 062f2H,063efH,064e8H,065ddH,066cfH,067bdH,068a6H,0698cH,06a6dH
- .word 06b4aH,06c24H,06cf9H,06dcaH,06e96H,06f5fH,07023H,070e2H,0719eH
- .word 07255H,07307H,073b5H,0745fH,07504H,075a5H,07641H,076d9H,0776cH
- .word 077faH,07884H,07909H,0798aH,07a05H,07a7dH,07aefH,07b5dH,07bc5H
- .word 07c29H,07c89H,07ce3H,07d39H,07d8aH,07dd6H,07e1dH,07e5fH,07e9dH
- .word 07ed5H,07f09H,07f38H,07f62H,07f87H,07fa7H,07fc2H,07fd8H,07fe9H
- .word 07ff6H,07ffdH,07fffH,07ffdH,07ff6H,07fe9H,07fd8H,07fc2H,07fa7H
- .word 07f87H,07f62H,07f38H,07f09H,07ed5H,07e9dH,07e5fH,07e1dH,07dd6H
- .word 07d8aH,07d39H,07ce3H,07c89H,07c29H,07bc5H,07b5dH,07aefH,07a7dH
- .word 07a05H,0798aH,07909H,07884H,077faH,0776cH,076d9H,07641H,075a5H
- .word 07504H,0745fH,073b5H,07307H,07255H,0719eH,070e2H,07023H,06f5fH
- .word 06e96H,06dcaH,06cf9H,06c24H,06b4aH,06a6dH,0698cH,068a6H,067bdH
- .word 066cfH,065ddH,064e8H,063efH,062f2H,061f1H,060ecH,05fe3H,05ed7H
- .word 05dc7H,05cb4H,05b9dH,05a82H,05964H,05842H,0571dH,055f5H,054caH
- .word 0539bH,05269H,05133H,04ffbH,04ebfH,04d81H,04c3fH,04afbH,049b4H
- .word 04869H,0471cH,045cdH,0447aH,04325H,041ceH,04073H,03f17H,03db8H
- .word 03c56H,03af2H,0398cH,03824H,036baH,0354dH,033deH,0326eH,030fbH
- .word 02f87H,02e11H,02c98H,02b1fH,029a3H,02826H,026a8H,02528H,023a6H
- .word 02223H,0209fH,01f19H,01d93H,01c0bH,01a82H,018f8H,0176dH,015e2H
- .word 01455H,012c8H,01139H,00fabH,00e1bH,00c8bH,00afbH,0096aH,007d9H
- .word 00647H,004b6H,00324H,00192H,00000H,0fe6eH,0fcdcH,0fb4aH,0F9b9H
- .word 0f827H,0f696H,0f505H,0f375H,0f1e5H,0f055H,0eec7H,0ed38H,0ebabH
- .word 0ea1eH,0e893H,0e708H,0e57eH,0e3f5H,0e26dH,0e0e7H,0df61H,0ddddH
- .word 0dc5aH,0dad8H,0d958H,0d7daH,0d65dH,0d4e1H,0d368H,0d1efH,0d079H
- .word 0cf05H,0cd92H,0cc22H,0cab3H,0c946H,0c7dcH,0c674H,0c50eH,0c3aaH
- .word 0c248H,0c0e9H,0bf8dH,0be32H,0bcdbH,0bb86H,0ba33H,0b8e4H,0b797H
- .word 0b64cH,0b505H,0b3c1H,0b27fH,0b141H,0b005H,0aecdH,0ad97H,0ac65H
- .word 0ab36H,0aa0bH,0a8e3H,0a7beH,0a69cH,0a57eH,0a463H,0a34cH,0a239H
- .word 0a129H,0a01dH,09f14H,09e10H,09d0eH,09c11H,09b18H,09a23H,09931H
- .word 09843H,0975aH,09674H,09593H,094b6H,093dcH,09307H,09236H,0916aH
- .word 090a1H,08fddH,08f1eH,08e62H,08dabH,08cf9H,08c4bH,08ba1H,08afcH
- .word 08a5bH,089bfH,08927H,08894H,08806H,0877cH,086f7H,08676H,085fbH
- .word 08583H,08511H,084a3H,0843bH,083d7H,08377H,0831dH,082c7H,08276H
- .word 0822aH,081e3H,081a1H,08163H,0812bH,080f7H,080c8H,0809eH,08079H
- .word 08059H,0803eH,08028H,08017H,0800aH,08003H,08001H,08003H,0800aH
- .word 08017H,08028H,0803eH,08059H,08079H,0809eH,080c8H,080f7H,0812bH
- .word 08163H,081a1H,081e3H,0822aH,08276H,082C7H,0831dH,08377H,083d7H
- .word 0843bH,084a3H,08511H,08583H,085fbH,08676H,086f7H,0877cH,08806H
- .word 08894H,08927H,089bfH,08a5bH,08afcH,08ba1H,08c4bH,08c4bH,08dabH
- .word 08e62H,08f1eH,08fddH,090a1H,0916aH,09236H,09307H,093dcH,094b6H
- .word 09593H,09674H,0975aH,09843H,09931H,09a23H,09b18H,09c11H,09d0eH
- .word 09e0fH,09f14H,0a01dH,0a129H,0a239H,0a34cH,0a463H,0a57eH,0a69cH
- .word 0a7beH,0a8e3H,0aa0bH,0ab36H,0ac65H,0ad97H,0aecdH,0b005H,0b141H
- .word 0b27fH,0b3c1H,0b505h,0b64cH,0b797H,0b8e4H,0ba33H,0bb86H,0bcdbH
- .word 0be32H,0bf8dH,0c0e9H,0c248H,0c3aaH,0c50eH,0c674H,0c7dcH,0c946H
- .word 0cab3H,0cc22H,0cd92H,0cf05H,0d079H,0d1efH,0d368H,0d4e1H,0d65dH
- .word 0d7daH,0d958H,0dad8H,0dc5aH,0ddddH,0df61H,0e0e7H,0e26dH,0e3f5H
- .word 0e57eH,0e708H,0e893H,0ea1eH,0ebabH,0ed38H,0eec7H,0f055h,0f1e5H
- .word 0f375H,0f505H,0f696H,0f827H,0f9b9H,0fb4aH,0fcdcH,0fe6eH
-