30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

fractcomplex* srcCV,<br />

fractcomplex* twidFactors,<br />

int factPage<br />

);<br />

Arguments: log2N based 2 logarithm of N (number of complex<br />

elements in source vector)<br />

srcCV pointer to source complex vector<br />

twidFactors base address of twiddle factors<br />

factPage memory page for transform factors<br />

Return Value: Pointer to base address of source complex vector.<br />

Remarks: N mustbe an integer power of 2.<br />

The elements in source complex vector are expected in natural order.<br />

The resulting transform is stored in bit reverse order.<br />

To avoid saturation (overflow) during computation, the magnitude of the<br />

values of the source complex vector should be in the range [-0.5, 0.5].<br />

Only the first N/2 twiddle factors are needed.<br />

If the twiddle factors are stored in X-Data space, twidFactorspoints<br />

to the actual address where the factors are allocated. If the twiddle<br />

factors are stored in program memory, twidFactorsis the offset from<br />

the program page boundary where the factors are allocated. This latter<br />

value can be calculated using the inline assembly operator<br />

psvoffset().<br />

If the twiddle factors are stored in X-Data space, factPagemust be<br />

set to 0xFF00 (defined value COEFFS_IN_DATA). If they are stored in<br />

program memory, factPageis the program page number containing<br />

the factors. This latter value can be calculated using the inline<br />

assembly operator psvpage().<br />

The twiddle factors mustbe initialized with conjFlagset to zero.<br />

Output is scaled by the factor 1/N.<br />

Source File: fft.asm<br />

DSP Library<br />

2004 Microchip Technology Inc. DS51456B-page 67<br />

Function Profile: System resources usage:<br />

W0..W7 used, not restored<br />

W8..W13 saved, used, restored<br />

ACCA used, not restored<br />

ACCB used, not restored<br />

CORCON saved, used, restored<br />

PSVPAG saved, used, restored (only if<br />

fractcomplex * dstCV,<br />

fractcomplex * srcCV,<br />

fractcomplex * twidFactors,<br />

int factPage<br />

);<br />

Đối số: log2N dựa 2 logarit của N (số yếu tố phức tạp<br />

trong vector nguồn)<br />

dstCV con trỏ đến đích vector phức tạp<br />

srcCV con trỏ đến nguồn vector phức tạp<br />

địa chỉ twidFactors cơ sở các yếu tố quay vòng<br />

trang bộ nhớ factPage cho chuyển đổi các yếu tố<br />

Quay trở lại giá trị: Con trỏ trỏ tới địa chỉ cơ sở của địa điểm vector phức tạp.<br />

FFTComplexIP (Tiếp theo)<br />

dsPIC<br />

®<br />

Thư viện Công cụ Ngôn ngữ<br />

DS51456B trang 68<br />

2004 Microchip Technology Inc<br />

Bình luận: N mustbe một sức mạnh nguyên 2.<br />

Chức năng này hoạt động trên place.A vector phức tạp, đủ để lớn<br />

nhận được kết quả của hoạt động này, mustalready đã được giao<br />

và giao cho dstCV.<br />

Các dstCVvector phải được phân bổ tại một liên kết modulo N.<br />

Các yếu tố trong nguồn vector phức tạp được dự kiến trong trật tự tự nhiên.<br />

Các yếu tố trong điểm đến vector phức tạp được tạo ra trong tự nhiên<br />

trật tự.<br />

Để tránh bão hòa (overflow) trong tính toán, độ lớn của<br />

giá trị của các nguồn phức tạp vector shouldbe trong khoảng [-0.5, 0.5].<br />

Nếu các yếu tố quay vòng được lưu trữ trong không gian X-Data,<br />

twidFactorspoints<br />

đến địa chỉ thực tế mà các yếu tố được phân bổ. Nếu quay vòng<br />

yếu tố được lưu trữ trong bộ nhớ chương trình, twidFactorsis bù đắp từ<br />

ranh giới trang chương trình mà các yếu tố được phân bổ. Sau này<br />

giá trị có thể được tính bằng cách sử dụng toán tử lắp ráp nội tuyến<br />

psvoffset ().<br />

Nếu các yếu tố quay vòng được lưu trữ trong không gian X-Data, factPagemust<br />

được<br />

thiết lập để 0xff00 (được định nghĩa COEFFS_IN_DATA giá trị). Nếu chúng<br />

được lưu trữ trong<br />

bộ nhớ chương trình, factPageis số trang có chứa chương trình<br />

các yếu tố. Giá trị sau này có thể được tính toán bằng cách sử dụng nội tuyến<br />

hành lắp ráp psvpage ().

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!