1 / 8

DSP24X 弦波產生器

DSP24X 弦波產生器. 指 導 教 授 : 簡 聰 富 學 生: 陳 俊 漢 學 號 : 19022004 班 級 : 二技機電三甲. X(n) = Sin nwT = X(z) = H(z) =. A =2coswT , B= -1 , C =sin wT , w =2πf , T =1/fs. 使用 IIR 數位濾波器理論產生 正弦波產生器. Y(z) =

Télécharger la présentation

DSP24X 弦波產生器

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DSP24X弦波產生器 指 導 教 授 : 簡 聰 富 學 生: 陳 俊 漢 學 號 : 19022004 班 級 : 二技機電三甲

  2. X(n) = Sin nwT = X(z) = H(z) = A=2coswT , B=-1, C=sin wT , w=2πf, T=1/fs 使用IIR數位濾波器理論產生正弦波產生器

  3. Y(z) = y(n) = 數位正弦振盪器方塊圖 上式轉移函數改寫如下:

  4. A = 2cos wT = 2cos(2*π(fd/fs)) = 1.90211 B = -1 C = sin wT = sin(2*π(fd/fs)) = 0.30902 fd:輸出頻率(500hz) fs:取樣頻率(10khz) A / 2*215 = 31164 = 079bch B / 2*215 = -16384 = 0c000h C / 2*215 = 5063 = 013c7h A,B,C係數

  5. .include f240regs.h .include initial.asm .bss X0,1 .bss X0,1 .bss Y0,1 .bss Y1,1 .bss Y2,1 .bss A,1 .bss B,1 .bss QUOT,1 .set 013c7h .set 079bch .set 0C000h .set 0080h .sect ".pvecs" PVECTORS B PHANTOM .space 76*16 B TPINT1_ISR .sect ".vectors" RSVECT B START INT1 B GISR2 .text START: NOP CALL initial LDP #X0 LACC #0 SACL Y0 SACL Y2 SPLK #Y1_INIT,Y1 SPLK #A_INIT,A SPLK #B_INIT,B LDP #DP_EV SPLK #8042H,T1CON SPLK #006AH,GPTCON SPLK #2000,T1PR 程式如下

  6. LACC #0 • MAR *,AR0 • LT *-,AR1 • MPY *-,AR0 • LTD *,AR1 • MPY *,AR0 • APAC • SACH Y0,1 • LACC Y0 • ADD Y0 • SACL Y0 • DMOV Y0 • RPT #3 • SFR • ADD #800H • SACL QUOT • OUT QUOT,DAX • CLRC INTM • RET • .END • SPLK #1000,T1CMPR • SPLK #0FFFEH,T1CNT • SPLK #09042H,T1CON • SPLK #IFRA_MASK,EVIMRA • LDP #0 • SPLK #02h,IMR • LACC IFR • CLRC INTM • wait nop • B wait • GISR2: • LDP #DP_EV • LACC EVRA,1 • LDP #0 • ADD #PVECTORS • BACC • TRINT1_ISR: • LDP #X0 • LAR ARO,#Y2 • LAR AR1,#B

  7. 輸 出 結 果 • 取樣頻率10kHz ; 輸出頻率500Hz • 10000/500=20個取樣點 輸 出 波 形 圖

  8. END…

More Related