converting this c code to matlab
조회 수: 4 (최근 30일)
이전 댓글 표시
Its urgent, converting this c code to matlab.
I am also trying but getting erros like
"Refernce to non-exitent"
icouldn't understand this issue.
please some1 help me to sort it out.
its more helpful, if u give converted matlab code also.
% typedef struct volCtrl
% {
% UINT8 u8CurrVolumeLevel;
% UINT8 u8CurrIDR_Min;
% UINT8 u8CurrIDR_Max;
% UINT8 u8IDR_MinPercent;
% UINT8 u8IDR_MaxPercent;
%
% }stVolCtrl;
% UINT32 SPU_VolumeControlGain()
% {
%
% /* Gain for neutral volume level */
% UINT32 u32BaselineGain = 0;
% UINT8 u8CurrIDR = 0;
% UINT8 u8StepGain = 0;
% UINT8 u8VolStep = 0;
% UINT32 u32VolGain = 0;
%
% gstVolCtrl.u8CurrIDR_Max = 80;
% gstVolCtrl.u8CurrIDR_Min = 20;
%
% gstVolCtrl.u8IDR_MaxPercent = 100;
% gstVolCtrl.u8IDR_MinPercent = 50;
%
%
% /* IDR calculate from Range */
% u8CurrIDR = gstVolCtrl.u8CurrIDR_Max - gstVolCtrl.u8CurrIDR_Min;
% /* Set Half of IDR as baseline Volume Gain */
% u32BaselineGain = u8CurrIDR >> 1;
%
% u8StepGain = (u32BaselineGain*gstVolCtrl.u8IDR_MaxPercent)/PERCENTAGE_VALUE;
% u8StepGain = u8StepGain /VOL_CTRL_DISC_STEPS_COUNT;
%
% if(gstVolCtrl.u8CurrVolumeLevel < VOLUME_STEP_BASELINE)
% {
% u8VolStep = VOLUME_STEP_BASELINE - gstVolCtrl.u8CurrVolumeLevel;
% u32VolGain = u8VolStep * u8StepGain;
% u32VolGain = u32BaselineGain - u32VolGain;
% }
% else
% {
% u8VolStep = gstVolCtrl.u8CurrVolumeLevel - VOLUME_STEP_BASELINE;
% u32VolGain = u8VolStep * u8StepGain;
% u32VolGain = u32BaselineGain + u32VolGain;
% }
% return u32VolGain;
% }
Thanks
Chinny
댓글 수: 3
Image Analyst
2018년 12월 13일
Make it easy for someone to help you - at least give the code that's mostly translated so we only have to fix the little that's left, not ALL of it.
Jan
2018년 12월 13일
Your message is easier to read, if you do not include a blank line after each line of text or code.
erros like "Refernce to non-exitent" - Please post your code and the complete error message. Then it is much easier to fix the code.
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!