フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Error when converting on matlab coder to cpp

1 回表示 (過去 30 日間)
멋진남자
멋진남자 2024 年 1 月 5 日
閉鎖済み: 멋진남자 2024 年 2 月 5 日
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% spectrogram calculation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
spec = zeros(winLenHalf+1,numOfFrames);
for i = 1 : numOfFrames
xi = xPadded(winPos(i):winPos(i) + winLen - 1) .* w;
if parameter.fftShift == 1
xi = fftshift(xi);
end
Xi = fft(xi);
spec(:,i) = Xi(1:winLenHalf+1); % This line is occured error when convert to C++.
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I convert to C++ use matlab coder so, occured below error message.
[problem code below]
spec(:,i) = Xi(1:winLenHalf+1);
[error message]
The left-hand side has been constrained to be non-complex, but the right-hand side is complex. To correct this problem, make the right-hand side real using the function REAL, or change the initial assignment to the left-hand side variable to be a complex value using the COMPLEX function.
[question]
How do I convert like a same matlab without loss original wav sound file?
I tried two method in error message but not same convert.
[download source code]
https://www.audiolabs-erlangen.de/resources/MIR/TSMtoolbox/
  5 件のコメント
멋진남자
멋진남자 2024 年 1 月 5 日
編集済み: Walter Roberson 2024 年 1 月 5 日
멋진남자
멋진남자 2024 年 2 月 5 日
Thank you for @madhan ravi, @Walter Roberson I soved this problem like that your comments.

回答 (0 件)

この質問は閉じられています。

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by