필터 지우기
필터 지우기

Constant requirement in codegen

조회 수: 2 (최근 30일)
Sean Little
Sean Little 2012년 10월 31일
I am trying to generate code from a function in the signal processing toolbox. I need to generate code for functions "hann" and "fir1". Here is a simple testcase:
function out = test(in)
%#codegen
assert(isa(in, 'double') && isscalar(in))
assert(in<1000)
out = hann(in);
The function above produces an error that indicates the HANN function requires a constant input. I see in the documentation a discussion of this, but the nature of my problem is such that the input is not constant as I am developing a programmable decimation filter. It seems to me that there must be a way to constrain the input such that the coder will know how big to allocate the output. (Hence my attempt to use the second ASSERT statement above).
Am I completely out of luck? Do I need to implement my own versions of HANN and FIR1?
Thanks.
  댓글 수: 1
Sean Little
Sean Little 2012년 10월 31일
I just wrote my own codegen compatible version of the HANN function. But FIR1 looks like it will be more problematic.

댓글을 달려면 로그인하십시오.

답변 (1개)

Sean Little
Sean Little 2012년 11월 1일
I am answering this for completeness. The response from technical support indicates that this is not supported and there are no work-arounds.

카테고리

Help CenterFile Exchange에서 Code Generation에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by