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.

involves<br />

transformations.<br />

2.7.2 Fractional Complex Vectors<br />

A complex data vector is represented by a data set in which every pair of values<br />

represents an element of the vector. The first value in the pair is the real part of<br />

the<br />

element, and the second its imaginary part. Both the real and imaginary parts are<br />

stored in memory using one word (two bytes) for each, and must be interpreted<br />

as<br />

1.15 fractionals. As with the fractional vector, the fractional complex vector<br />

stores its<br />

elements consecutively in memory.<br />

The organization of data in a fractional complex vector may be addressed by the<br />

following data structure:<br />

#ifdef fractional<br />

#ifndef fractcomplex<br />

typedef struct {<br />

fractional real;<br />

fractional imag;<br />

} fractcomplex;<br />

#endif<br />

#endif<br />

DSP Library<br />

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

2.7.3 User Considerations<br />

a) No boundary checking is performed by these functions. Out of range sizes<br />

(including zero length vectors) as well as nonconforming use of source complex<br />

vectors and factor sets may produce unexpected results.<br />

b) It is recommended that the Status register (SR) is examined after completion<br />

of<br />

each function call. In particular, users can inspect the SA, SB and SAB flags<br />

after<br />

the function returns to determine if saturation occurred.<br />

c) The input and output complex vectors involved in the family of<br />

transformations<br />

mustbe allocated in Y-Data memory. Transforms factors may be allocated either<br />

in X-Data or program memory.<br />

d) Because bit reverse addressing requires the vector set to be modulo aligned,<br />

the<br />

input and output complex vectors in operations using either explicitly or<br />

implicitly<br />

the BitReverseComplexfunction must be properly allocated.<br />

e) Operations which return a destination complex vector can be nested, so that<br />

Chức năng này hoạt động tại chỗ.<br />

Source File: bitrev.asm<br />

Chức năng thông tin: sử dụng nguồn tài nguyên của hệ thống:<br />

W0..W7 sử dụng, không được khôi phục<br />

MODCON lưu, sử dụng, phục hồi<br />

XBREV lưu, sử dụng, phục hồi<br />

DOand REPEATinstruction sử dụng:<br />

1 DOinstructions cấp<br />

không REPEATinstructions<br />

Từ chương trình (hướng dẫn 24-bit):<br />

27<br />

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

Chuyển đổi Size # # Complex yếu tố chu kỳ<br />

32 điểm 32 245<br />

64 điểm 64 485<br />

128 điểm 128 945<br />

256 điểm 256 1905<br />

DSP Thư viện<br />

2004 Microchip Technology Inc DS51456B trang 61<br />

CosFactorInit<br />

Mô tả: CosFactorInitgenerates nửa đầu tập hợp các yếu tố cosin<br />

yêu cầu của một loại II Discrete Cosine Transform, và đặt kết quả<br />

trong vector đến phức tạp. Hiệu quả, tập chứa<br />

giá trị:<br />

, Trong đó 0 ≤k<br />

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

Prototype: fractcomplex extern * CosFactorInit (<br />

int log2N,<br />

fractcomplex * cosFactors<br />

);<br />

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

cần thiết bởi một DCT)<br />

cosFactors con trỏ đến các yếu tố phức tạp cosine<br />

Quay trở lại giá trị: Con trỏ trỏ tới địa chỉ cơ sở các yếu tố cos.<br />

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

Chỉ có N / 2 cosinefactors đầu tiên được tạo ra.<br />

Một vector phức tạp có kích thước N / 2 musthave đã được phân bổ và<br />

giao cho cosFactorsprior để gọi hàm. Các phức tạp<br />

vector shouldreside trong bộ nhớ X-Data.

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

Saved successfully!

Ooh no, something went wrong!