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.

and<br />

stores the results in the destination vector.<br />

Include: dsp.h<br />

Prototype: extern fractional* DCT (<br />

int log2N,<br />

fractional* dstV,<br />

fractional* srcV,<br />

fractcomplex* cosFactors,<br />

fractcomplex* twidFactors,<br />

int factPage<br />

);<br />

CN k () e<br />

j<br />

πk<br />

2N<br />

-------=<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

cộng thêm từ chương trình từ VectorZeroPad, và DCTIP.<br />

Chu kỳ (bao gồm cả cuộc gọi C-chức năng và trả các chi phí):<br />

22<br />

cộng với chu kỳ từ VectorZeroPad, và DCTIP.<br />

Lưu ý: Trong các mô tả về số VectorZeroPadthe của chu kỳ<br />

báo cáo bao gồm 4 chu kỳ của C-chức năng gọi điện trên không. Như vậy,<br />

số chu kỳ thực tế từ VectorZeroPadto thêm vào DCTis 4 ít<br />

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

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

3 ít hơn bất cứ điều gì numberis báo cáo cho một đứng một mình DCTIP.<br />

DCT (Tiếp theo)<br />

12N () /<br />

DSP Thư viện<br />

2004 Microchip Technology Inc DS51456B trang 63<br />

DCTIP<br />

Mô tả: DCTIPcomputes rời rạc Cosine Transform của một vector nguồn trong<br />

nơi.<br />

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

Nguyên mẫu: ở ngoài phân đoạn * DCTIP (<br />

DS51456B-page 62<br />

2004 Microchip Technology Inc.<br />

int log2N,<br />

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

elements in source vector)<br />

dstCV pointer to destination vector<br />

srcCV pointer to source vector<br />

cosFactors pointer to cosine factors<br />

twidFactors pointer to twiddle factors<br />

factPage memory page for transform factors<br />

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

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

This function operates out of place. A vector of size 2N elements, must<br />

already have been allocated and assigned to dstV.<br />

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

The results of computation are stored in the first N elements of the<br />

destination vector.<br />

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

source vector shouldbe in the range [-0.5, 0.5].<br />

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

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

If the transform factors are stored in X-Data space, cosFactorsand<br />

phân đoạn * srcV,<br />

fractcomplex * cosFactors,<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 />

srcCV con trỏ tới vector nguồn<br />

cosFactors con trỏ đến các yếu tố cosin<br />

twidFactors con trỏ đến 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 vector đích.<br />

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

Chức năng này hy vọng rằng sourcevector đã không đệm để<br />

chiều dài 2N.<br />

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

Các kết quả tính toán được lưu trữ trong các yếu tố đầu tiên của nguồn N<br />

vector.<br />

Để tránh bão hòa (overflow) trong tính toán, giá trị của các

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

Saved successfully!

Ooh no, something went wrong!