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.

int log2N,<br />

fractcomplex* dstCV,<br />

fractcomplex* srcCV,<br />

fractcomplex* twidFactors,<br />

int factPage<br />

);<br />

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

in source vector)<br />

dstCV pointer to destination complex 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 destination complex vector.<br />

DCTIP (Continued)<br />

DSP Library<br />

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

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

This function operates out of place.A complex vector, large enough to<br />

receive the results of the operation, mustalready have been allocated<br />

and assigned to dstCV.<br />

The dstCVvector must be allocated at a modulo alignment of N.<br />

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

The elements in destination complex vector are generated in natural<br />

order.<br />

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

values of the source complex vector shouldbe 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 />

cùng một cách, số chu kỳ thực tế từ FFTComplexIPto thêm vào<br />

FFTComplexis 4 ít hơn bất cứ số được báo cáo cho một đứng<br />

FFTComplexIP mình. Và những từ BitReverseComplexare 2<br />

ít hơn bất cứ số được báo cáo cho một FFTComplex đứng một mình.<br />

FFTComplex (Tiếp theo)<br />

dsPIC<br />

®<br />

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

DS51456B trang 66<br />

FFTComplexIP<br />

2004 Microchip Technology Inc<br />

Mô tả: FFTComplexIPcomputes rời rạc đổi Fourier của một nguồn<br />

vector phức tạp tại chỗ ..<br />

Bao gồm: dsp.h<br />

Prototype: fractcomplex extern * FFTComplexIP (<br />

int log2N,<br />

fractcomplex * srcCV,<br />

fractcomplex * twidFactors,<br />

int factPage<br />

);<br />

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

phần tử trong vector nguồn)<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 nguồn vector phức tạp.<br />

Bình luận: N mustbe một sức mạnh nguyên 2.<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 kết quả chuyển đổi được lưu trữ trong bit thứ tự ngược.<br />

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

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

Chỉ có các yếu tố N / 2 quay vòng đầu tiên là cần thiết.<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

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

Saved successfully!

Ooh no, something went wrong!