30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Language Tools Libraries<br />

DS51456B-page 58<br />

2.7 TRANSFORM FUNCTIONS<br />

2004 Microchip Technology Inc.<br />

This section presents the concept of a fractional transform, as considered by the<br />

DSP<br />

Library, and describes the individual functions which perform transform<br />

operations.<br />

2.7.1 Fractional Transform Operations<br />

A fractional transform is a linear, time invariant, discrete operation that when<br />

applied to<br />

a fractional time domain sample sequence, results in a fractional frequency in<br />

the frequency domain. Conversely, inverse fractional transform operation, when<br />

applied to<br />

frequency domain data, results in its time domain representation.<br />

A set of transforms (and a subset of inverse transforms) are provided by the<br />

DSP<br />

Library. The first set applies a Discrete Fourier transform (or its inverse) to a<br />

complex<br />

data set (see below for a description of fractional complex values). The second<br />

set<br />

applies a Type II Discrete Cosine Transform (DCT) to a real valued sequence.<br />

These<br />

transforms have been designed toeither operate out-of-place, or in-place. The<br />

former<br />

type populates an output sequence with the results of the transformation. In the<br />

latter,<br />

the input sequence is (physically) replaced by the transformed sequence. For<br />

out-of-place operations, enough memory to accept the results of the<br />

computation must<br />

be provided.<br />

The transforms make use of transform factors (or constants) which must be<br />

supplied to<br />

the transforming function during its invocation.These factors, which are<br />

complex data<br />

sets, are computed in floating point arithmetic, and then transformed into<br />

fractionals for<br />

use by the operations. To avoid excessive computational overhead when<br />

applying a<br />

transformation, a particular set of transform factors could be generated once and<br />

used<br />

many times during the execution of the program. Thus, it is advisable to store<br />

the<br />

factors returned by any of the initialization operations in a permanent (static)<br />

complex<br />

vector. It is also advantageous to generate the factors “off-line”, and place them<br />

in program memory, and use them when the program is later executing. This<br />

way, not only<br />

cycles, but also RAM memory is saved when designing an application which<br />

nguồn phức tạp<br />

vectơ và bộ yếu tố có thể tạo ra kết quả bất ngờ.<br />

b) Đó là khuyến cáo rằng tình trạng đăng ký (SR) được kiểm tra sau khi hoàn<br />

thành<br />

mỗi lần gọi hàm. Đặc biệt, người dùng có thể kiểm tra việc SA, SB và SAB cờ<br />

sau<br />

hàm trả về để xác định độ bão hòa xảy ra.<br />

c) Các vectơ đầu vào và đầu ra phức tạp liên quan đến gia đình của biến đổi<br />

mustbe phân bổ trong bộ nhớ Y-Data. Chuyển dạng các yếu tố có thể được phân<br />

bổ hoặc<br />

trong X-dữ liệu hoặc bộ nhớ chương trình.<br />

d) Bởi vì chút đảo ngược quyết yêu cầu vector thiết lập để được Modulo liên<br />

kết, các<br />

đầu vào và đầu ra phức tạp vector trong hoạt động bằng cách sử dụng một cách<br />

rõ ràng hoặc ngầm<br />

các BitReverseComplexfunction phải được phân bổ đúng cách.<br />

e) Các hoạt động đó trở về một điểm đến vector phức tạp có thể được lồng vào<br />

nhau, để cho<br />

Chẳng hạn, nếu:<br />

a = OP1 (b, c), với b = OP2 (d) và c = op3 (e, f), sau đó<br />

a = OP1 (OP2 (d), op3 (e, f)).<br />

dsPIC<br />

®<br />

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

DS51456B trang 60<br />

2.7.4 Chức năng cá nhân<br />

2004 Microchip Technology Inc<br />

Trong phần tiếp theo, các chức năng cá nhân thực hiện chuyển đổi và nghịch<br />

đảo<br />

hoạt động được mô tả.<br />

BitReverseComplex<br />

Mô tả: BitReverseComplexreorganizes các yếu tố của một vector phức tạp<br />

trong bit thứ tự ngược lại.<br />

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

Prototype: fractcomplex extern * BitReverseComplex (<br />

int log2N,<br />

fractcomplex * srcCV<br />

);<br />

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

vector nguồn)<br />

srcCV con trỏ đến nguồn vector phức tạp<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 srcCVvector phải được phân bổ tại một liên kết modulo N.

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

Saved successfully!

Ooh no, something went wrong!