Clear Filters
Clear Filters

Matlab to C Conversion issue

3 views (last 30 days)
Hari Ijjada
Hari Ijjada on 30 Aug 2019
Edited: madhan ravi on 30 Aug 2019
I am running a program consists of two funtions demodualtion and modulation and by using command like
output= mainfuntion.Subfuntion(input arguments) i called them into script .while running the script i am getting the output and i am able to call the funtions individually.But while Converting the Matlab to C i am facing the issue...what should i do ?
classdef AmModDemod_DSB_C_Func
methods(Static)
function [z] = AmMod_DSB_C(Ac,Am,inp,carrier,carrierhilbert)
inphasecomp=Ac*(1+(Am/Ac)*inp');
outphasecomp=0;
z=inphasecomp.*carrier-outphasecomp.*carrierhilbert;
end
function [out] = AmDemod_DSB_C(z,carrier)
a=z.*carrier;
lpFilt = designfilt('lowpassfir', 'PassbandFrequency', 0.333,...
'StopbandFrequency',0.5, 'PassbandRipple', 0.02, ...
'StopbandAttenuation', 65, 'DesignMethod', 'kaiserwin');
dataout = filter(lpFilt,a);
DCB= dsp.DCBlocker('Algorithm','FIR','Length', 100);
out=step(DCB,dataout');
end
end
end
mod=AmModDemod_DSB_C_Func.AmMod_DSB_C(Ac,Am,inp,carrier,carrierhilbert);
demod=AmModDemod_DSB_C_Func.AmDemod_DSB_C(mod,carrier);
This is type of the error i am getting ...

Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!