| ²é¿´: 1208 | »Ø¸´: 4 | |||
jianchaoyv½ð³æ (СÓÐÃûÆø)
|
[½»Á÷]
¡¾ÇóÖú¡¿Çë°ïæ¿´Ò»¸ö»ã±àº¯Êý
|
|
/*********************************************************************** * _DFT_Fundamental: * calculate DFT transform for the fundamental waveform * this routine could be use to calculate the phase of fundamental waveform * which equals to atan(A(1)/B(1)) * * Operation: * F(1) = (1/N)* sum_n (f(n)*WN(n)), WN(n) = exp[-(j*2*pi*n)/N], * n in {0, 1,... , N-1}, * F(2) = (1/N)* sum_n (f(n)*WN(n)), WN(n) = exp[-(j*2*pi*n)/N], * n in {N, 1,... , 2*N-1}, * * calculate: * cycle 1 's DFT transform * and cycle 2 's DFT transform * Input: * w0 = number of source data per cycle * w1 = ptr to source vector (srcCV) ----- data should be stored in Y-DATA memory * w2 = ptr to output value * w3 = ptr to cos_sin table * w4 = COEFFS_IN_DATA, or memory program page with cos_sin table * w5 = calculate cycle number * Return: * null * result store in (w2) array, where * (w2 ) = F(1).real * (w2+1) = F(1).imag * (w2+2) = F(2).real * (w2+3) = F(2).imag * * System resources usage: * {w0..w7} used, not restored * {w8..w13} saved, used, restored * AccuA used, not restored * AccuB used, not restored * CORCON saved, used, restored * PSVPAG saved, used, restored (if factors in P memory) * * one loop stage usage. * instruction cycle: * w0 * 4 + * execution time under 30MIPS: * Design By: Jemmey Huang CADC * Last modification: Oct 8 / 2006 ***********************************************************************/ _DFT_Fundamental: push.d w8 ; {w8,w9} to TOS push.d w10 ; {w10,w11} to TOS push.d w12 ; {w12,w13} to TOS ;............................................................................ ; Prepare CORCON for fractional computation. push CORCON bset CORCON, #4 ;ACCSAT = 1, Set 9.31 mode bset CORCON, #6 ;ACCSAT = 1, Set 9.31 mode bset CORCON, #7 ;ACCSAT = 1, Set 9.31 mode ;............................................................................ ; Prepare CORCON and PSVPAG for possible access of data ; located in program memory, using the PSV. push PSVPAG; mov #COEFFS_IN_DATA,w7 ; w7 = COEFFS_IN_DATA psvaccess w7 ; enable PSV bit in CORCON mov w4,PSVPAG ; load PSVPAG with program ; space page offset ; from here w4 can be used for other job mov w5, w9 ; cycle number store to w9 mov w0, w7 ; data length = N dec w7, w7 ; N-1 ; from here, ; w0 data length N ; w1 source data start address ; w2 return data start address ; w3 table start address for cosx ; w4 not use ; w5, w6 use by MAC ; w7 loop counter = N-1 ; w8 X data pointer to the sin_cos table ; w9 cycle number ; w10 Y data pointer to the f(i) ; w11 not use ; w12 not use ; w13 not use mov w1, w11 _loop_cycls: mov w11, w10 ; source data begining address mov w3, w8 ; cos table begining address clr A mov [w10++], w6 ; pre-fetch source data mov [w8++], w5 ; pre-fetch cos table repeat w7 mac w5*w6, a, [w8]+=2, w5, [w10]+=2, w6 sac.r a, #5, [w2++] ; stored real value of cycle 1 mov w11, w10 ; retrive source data begining address mov [w10++], w6 ; pre-fetch data f(1) clr A repeat w7 ; repeat N time mac w5*w6, a, [w8]+=2, w5, [w10]+=2, w6 sac.r a, #5, [w2++] ; stored image value of cycle 1 >>20 add w11, w0, w11 add w11, w0, w11 dec w9, w9 ; w9-- bra gt,_loop_cycls ; if w0 > 0, do next stage ; Restore PSVPAG and CORCON. pop PSVPAG pop CORCON pop.d w12 ; {w12,w13} to TOS pop.d w10 ; {w10,w11} to TOS pop.d w8 ; {w8,w9} to TOS return ÆäÖÐÕⲿ·Ö£º ; Prepare CORCON and PSVPAG for possible access of data ; located in program memory, using the PSV. push PSVPAG; mov #COEFFS_IN_DATA,w7 ; w7 = COEFFS_IN_DATA psvaccess w7 ; enable PSV bit in CORCON mov w4,PSVPAG ; load PSVPAG with program ; space page offset ; from here w4 can be used for other job ÊÇʲôÒâ˼£¿¼±Çó°ïÖú£¡£¡£¡ |
» ²ÂÄãϲ»¶
081700£¬311£¬Çóµ÷¼Á
ÒѾÓÐ15È˻ظ´
Ò»Ö¾Ô¸±±¾©»¯¹¤085600 310·ÖÇóµ÷¼Á
ÒѾÓÐ18È˻ظ´
085600²ÄÁÏÓ뻯¹¤301·ÖÇóµ÷¼ÁԺУ
ÒѾÓÐ4È˻ظ´
²ÄÁÏÓ뻯¹¤371Çóµ÷¼Á
ÒѾÓÐ14È˻ظ´
336²ÄÁÏÓ뻯¹¤085600Çóµ÷¼Á
ÒѾÓÐ7È˻ظ´
²ÄÁÏ334Çóµ÷¼Á
ÒѾÓÐ18È˻ظ´
331Çóµ÷¼Á
ÒѾÓÐ8È˻ظ´
332Çóµ÷¼Á
ÒѾÓÐ17È˻ظ´
Ò»Ö¾Ô¸ÄϾ©º½¿Õº½Ìì´óѧ ²ÄÁÏÓ뻯¹¤329·ÖÇóµ÷¼Á
ÒѾÓÐ4È˻ظ´
²ÄÁÏר˶322
ÒѾÓÐ7È˻ظ´
» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:
¹òÇó1stOpt2.5ÒÔÉϰ汾£¬»òÕßÇë¸ßÈ˰ïæÄâºÏ°üº¬¸´ÊýµÄº¯ÊýµÄ²ÎÊý
ÒѾÓÐ8È˻ظ´
Çë½ÌÏ£ºÈçºÎÇóÒ»¸öº¯ÊýÔÚÒ»¶¨·¶Î§ÄÚµÄÈ«²¿½â
ÒѾÓÐ10È˻ظ´
Âú×ãÒ»¶¨Ìõ¼þ£¨¼«Ð¡Öµ£©µÄº¯ÊýµÄ¹¹Ô죬Çë¸ßÊÖ°ïæ£¡Ð»Ð»
ÒѾÓÐ11È˻ظ´
ºãìØºãÈÝÖ»×öÌå»ý¹¦µÄ·â±ÕÌåϵÀÌåϵ´ïƽºâ£¬¿´Äĸö״̬º¯Êý
ÒѾÓÐ12È˻ظ´
°ïæ¿´¿´Í¼Öй¦º¯ÊýÔõô¶ÁÈ¡
ÒѾÓÐ8È˻ظ´
ÇóÖú£ºÄܲ»Äܰïæдһ¸öÓÃmatlabÇóÒ»¸öº¯ÊýµÄ¸µÀïÒ¶±ä»»µÄ³ÌÐò
ÒѾÓÐ16È˻ظ´
Çó°ï棬¹ØÓÚº¬ÓÐbesselº¯ÊýµÄ·½³ÌµÄ±à³ÌÇó½âÎÊÌâ
ÒѾÓÐ11È˻ظ´
¡¾ÇóÖú¡¿ÄÄλ´óÏÀÄܰïÎÒ¿´¿´Ò»¸ö²»µÈʽµÄÎÊÌ⣬Çóº¯ÊýµÄ½ç
ÒѾÓÐ10È˻ظ´
¡¾ÇóÖú¡¿ÇóÖúÒ»¸öÖÜÆÚÅÅÁÐÊý¾ÝµÄ º¯ÊýÐÎʽ£¬Çë³æÓÑÖ¸µã£¡
ÒѾÓÐ5È˻ظ´
¡¾ÇóÖú¡¿Ò»¸öÖ¸Êýº¯ÊýµÄ»ý·Ö£¡
ÒѾÓÐ3È˻ظ´
¡¾ÇóÖú¡¿ÇëÎÊÔõô»¯¼ò£¿Ïë°ÑÕâ¸ö»¯³ÉÒ»¸öÏà¶Ô¼òµ¥µÄº¯ÊýÐÎʽ£¬Çó¸÷λ´óÏÀ°ï棡лл£¡
ÒѾÓÐ6È˻ظ´
¡¾ÇóÖú¡¿Çë½ÌÒ»¸öÒþº¯ÊýµÄÇóµ¼ÎÊÌâ
ÒѾÓÐ10È˻ظ´
¡¾½»Á÷¡¿VC++, C#, VB´ðÒÉרÌù
ÒѾÓÐ145È˻ظ´
fengyu027
ľ³æ (ÕýʽдÊÖ)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 2687.4
- É¢½ð: 84
- ºì»¨: 1
- Ìû×Ó: 684
- ÔÚÏß: 155.5Сʱ
- ³æºÅ: 705479
- ×¢²á: 2009-02-21
- רҵ: ÎÞ»úºÏ³ÉºÍÖÆ±¸»¯Ñ§

2Â¥2010-08-23 16:01:11
hn911
½ð³æ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 1095.7
- Ìû×Ó: 113
- ÔÚÏß: 66Сʱ
- ³æºÅ: 809879
- ×¢²á: 2009-07-16
- רҵ: ×ÔÈ»ÓïÑÔÀí½âÓë»úÆ÷·Òë
¡ï
ÓàÔó³É(½ð±Ò+1):лл²ÎÓëÓ¦Öú£¡ 2010-09-10 16:16:25
ÓàÔó³É(½ð±Ò+1):лл²ÎÓëÓ¦Öú£¡ 2010-09-10 16:16:25
| ÕâÊǼÆËã»ù±¾²¨ÐεÄÀëÉ¢¸µÀïҶת»» |
3Â¥2010-09-10 14:59:31
siqin123
гæ (ÕýʽдÊÖ)
- Ó¦Öú: 1 (Ó×¶ùÔ°)
- ½ð±Ò: 627.8
- É¢½ð: 2
- ºì»¨: 1
- Ìû×Ó: 502
- ÔÚÏß: 58.7Сʱ
- ³æºÅ: 1161110
- ×¢²á: 2010-12-02
- ÐÔ±ð: MM
- רҵ: ¼ÆËã»úÓ¦Óü¼Êõ
¡ï
΢³¾¡¢ÃÎÏë(½ð±Ò+1): лл»Ø¸´¡¡ 2011-04-14 21:07:24
΢³¾¡¢ÃÎÏë(½ð±Ò+1): лл»Ø¸´¡¡ 2011-04-14 21:07:24
| ÇóÓë·´ÕýÇк¯ÊýµÈÖµµÄÀëÉ¢¸µÀïÒ¶±ä»» |

4Â¥2011-01-14 21:05:21
huycwork
½ð³æ (ÖøÃûдÊÖ)
- ³ÌÐòÇ¿Ìû: 22
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 953
- É¢½ð: 663
- ºì»¨: 8
- ɳ·¢: 13
- Ìû×Ó: 1080
- ÔÚÏß: 264.1Сʱ
- ³æºÅ: 1257243
- ×¢²á: 2011-04-06
- רҵ: ½ðÈÚѧ
¡ï
΢³¾¡¢ÃÎÏë(½ð±Ò+1): лл»Ø¸´¡¡ 2011-04-14 21:07:39
΢³¾¡¢ÃÎÏë(½ð±Ò+1): лл»Ø¸´¡¡ 2011-04-14 21:07:39
|
; Prepare CORCON and PSVPAG for possible access of data ;ÕâÀï¾Í˵Ã÷ÁËCORCONºÍPSVPAGÊÇÁ½¸ö״̬¼Ä´æÆ÷ ; located in program memory, using the PSV. ;ÉèÖóÌÐò״̬£¬ÆôÓÃPSVλ push PSVPAG; ;±¸·Ý¼Ä´æÆ÷ mov #COEFFS_IN_DATA,w7 ; ¸³Öµ£¬COEFFS_IN_DATAÊdz£Á¿Öµ psvaccess w7 ; ´ò¿ªCORCON¼Ä´æÆ÷ÖеÄPSVλ mov w4,PSVPAG ; Ϊ³ÌÐòÉèÖÃPSVPAG ============================================================================ ÉÏÃæÊÇ´óÌåÒâ˼£¬¾ßÌå¶øÑÔ£¬Ó¦¸Ã·Ôĵ¥Æ¬»úÊÖ²áÒԲ鿴CORCONºÍPSVPAGÕâÁ½¸ö¼Ä´æÆ÷¸ÉÂïÓõģ¬Òòµ¥Æ¬»úµÄ²»Í¬£¬¹¦ÄÜÒ²²»¾¡Ïàͬ |

5Â¥2011-04-13 23:25:30














»Ø¸´´ËÂ¥