von Markus (Guest)

Rate this post
0 useful
not useful
hi guys,

i am working on a student bachelor thesis where i should implement a BTC 
from matlab to the SHARC ADSP-21369 EZ-Kit to edit parameters for a 
simple 3-band-EQ during the board's runtime.

i have now a class in matlab including the methods for accessing, 
writing and reading the BTC and i have initialized the channels in 
VisualDSP++ like shown in the getting started example.

now i have the following problem:

i will transmit filter coefficients für a biquad filter, so the 
numerator-coefficients are 3x1 cell array, the denominator-coeffs 2x1 
cell array

if i try to send these values through the BTC, the BTC memory window 
shows me, that only one single coefficient of the array is edited, the 
others get 0. a very interesting point is, that in the 3x1 cell array 
the 2nd coefficient is edited, the first and the third get zero.

has anyone an idea how to fix this? i would need quite a quick solution, 
because i have to presentate my project on monday.

here is the code ob my accessBTC.m
classdef accessBTC < handle


    numChannels = [];

    isInitialized = 0; %Logical 0 or 1 to indicate if the class is instantiated to connect to the VisualDSP session


properties(SetAccess = private)

    channelList = {}; % Array of channel objects



    function initialize(obj)

        a = actxserver('VisualDSP.ADspApplication');

        btcPlugin      = a.PluginList.invoke('Item','BtcManager');

        btcManager     = btcPlugin.Open;

        btcChannelList = btcManager.ChannelList(int16(0));       % Get the channel list in processor #0 (always INT16)

        obj.numChannels = btcChannelList.Count;

        disp(['Total Number of Channels: ', num2str(obj.numChannels)]);

        % Create the BTC Channel interfaces

        for i = 1: obj.numChannels

            obj.channelList{i} = btcChannelList.invoke('Item',int32(i-1));


        obj.isInitialized = 1;

       % S=saveobj(obj);

   end % End of Method: INITIALIZE

    function outVal = read(obj,channelNum,width)

        % Default width is 32; other possible values: 16, 8

        % Channel num starts frm 0

        if nargin ==2

            width = 32;


        widthStr = ['btcWidth',num2str(width)];

        btcChan = obj.channelList{channelNum};

        out_val = btcChan.Read(widthStr);

        outVal = cell2mat(out_val);

    end % End of Method: READ

    function write(obj, channelNum, val)

        % input val needs to be a scalar or a vector of int32 or in16 or

        % int8 values

        % Channel num starts frm 0

        if nargin ~=3

            error('WRITE method for accessBTC object needs 2 inputs.')


        btcChan = obj.channelList{channelNum+1};


    end %End of Method: WRITE

    function reset(obj)

        obj.numChannels = [];

        obj.isInitialized = 0;

        obj.channelList = [];

    end %End of Method: RESET


so if i sending for example these single arrays
    num_1 = [1.324; -1.45; 0.83]
    den_1 = [-1.45; 0.74]

i am getting in my BTC memory window as floating point
    num_1 = [0.0000000; -1.45; 0.0000000]
    den_1 = [-1.45; 0.0000000]

has anybody an idea how to fix this?

thanks a lot and best regards,



Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.