IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Simulink Discussion :

Carte dsp TMS320DSK6713


Sujet :

Simulink

  1. #1
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2011
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Décembre 2011
    Messages : 8
    Points : 4
    Points
    4
    Par défaut Carte dsp TMS320DSK6713
    bonjour a tous,

    Je suis en train d’implémenter un programme de reconnaissance des mots isolés par les chaines de Markov cachées sur une carte DSP 6713. J'ai utilisé Simulink pour schématiser les étapes de mon algorithme, mon problème est le suivant:
    - Mes programmes sont tous des fichiers .m, je voudrais les transférer vers Simulink. J'ai utilisé "Embedded function" mais il m'a donné un journal d'erreur. SVP help me...
    - Je voudrais accéder au port de la daughter card avec Simulink, je n'ai pas trouvé comment et quelle fonction je dois utiliser.

    Merci pour votre attention.

  2. #2
    Rédacteur/Modérateur

    Avatar de Jerome Briot
    Homme Profil pro
    Freelance mécatronique - Conseil, conception et formation
    Inscrit en
    Novembre 2006
    Messages
    20 302
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Freelance mécatronique - Conseil, conception et formation

    Informations forums :
    Inscription : Novembre 2006
    Messages : 20 302
    Points : 52 884
    Points
    52 884
    Par défaut
    Citation Envoyé par saraha1981 Voir le message
    il ma donne un jurnal d'erreur.
    Montre nous le message d'erreur complet.
    Ingénieur indépendant en mécatronique - Conseil, conception et formation
    • Conception mécanique (Autodesk Fusion 360)
    • Impression 3D (Ultimaker)
    • Développement informatique (Python, MATLAB, C)
    • Programmation de microcontrôleur (Microchip PIC, ESP32, Raspberry Pi, Arduino…)

    « J'étais le meilleur ami que le vieux Jim avait au monde. Il fallait choisir. J'ai réfléchi un moment, puis je me suis dit : "Tant pis ! J'irai en enfer" » (Saint Huck)

  3. #3
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2011
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Décembre 2011
    Messages : 8
    Points : 4
    Points
    4
    Par défaut
    Citation Envoyé par Dut Voir le message
    Montre nous le message d'erreur complet.
    bonjour,
    j'ai commence par le bloc d'extraction des paramettres MFCC, j'ai recu les messages d'erreur suivants:
    1-The function 'hamming' is not supported by Embedded MATLAB for code generation. See the documentation for eml.extrinsic to learn how you can use this function in simulation.
    
    Function 'Embedded MATLAB Function' (#118.1293.1300), line 38, column 16:
    "hamming"
    2-Errors occurred during parsing of Embedded MATLAB function 'Embedded MATLAB
    Function'(#118)
    3-Embedded MATLAB Interface Error: Errors occurred during parsing of Embedded MATLAB function 'Embedded MATLAB Function'(#118)
    .

  4. #4
    Expert confirmé
    Avatar de duf42
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Novembre 2007
    Messages
    3 111
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Formateur en informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2007
    Messages : 3 111
    Points : 4 661
    Points
    4 661
    Par défaut
    Bonjour,

    Comme le dit le message d'erreur, tu ne peux pas utiliser directement la fonction HAMMING dans une Embedded MATLAB Function. Pour l'utiliser il faut que tu la déclares avec eml.extrinsic:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    eml.extrinsic('hamming');
    Duf
    Simulink & Embedded Coder

    Au boulot : Windows 7 , MATLAB r2016b
    A la maison : ArchLinux mais pas MATLAB

  5. #5
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2011
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Décembre 2011
    Messages : 8
    Points : 4
    Points
    4
    Par défaut TMS320DSK6713
    bonjour;
    j'ai utilise cette fonction eml.extrinsic, il m'a sauve la vie mais le simulink il ma donnee une autre liste d'erreur, a savoir:
    -Embedded MATLAB Interface Error: Errors occurred during parsing of Embedded MATLAB function 'Embedded MATLAB Function'(#20) .
    -Errors occurred during parsing of Embedded MATLAB function 'Embedded MATLAB Function'(#20) 
    -Error limit reached.  Suppressing further error messages. Function 'Embedded MATLAB Function' (#20.2033.2035), line 80, column 26: "vx"
    -Undefined function or variable 'vx'. The first assignment to a local variable determines its class. Function 'Embedded MATLAB Function' (#20.1994.1996), line 79, column 3: "vx"
    -Undefined function or variable 'cx'. The first assignment to a local variable determines its class.Function 'Embedded MATLAB Function' (#20.1974.1976), line 78, column 26: "cx"
    Undefined function or variable 'c'. The first assignment to a local variable determines its class. Function 'Embedded MATLAB Function' (#20.1924.1925), line 77, column 7: "c"
    -Subscripting into an mxArray is not supported. Function 'Embedded MATLAB Function' (#20.1467.1475), line 46, column 4: "f(a:b,:)"
    ces variables n'ont pas ete deffiner dans le programme .m, masi il a fonctionne tres bien, et lorsque j'ai l'envoye au simulink il m'a donnee les erreur cite supra???
    merci.

  6. #6
    Expert confirmé
    Avatar de duf42
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Novembre 2007
    Messages
    3 111
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Formateur en informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2007
    Messages : 3 111
    Points : 4 661
    Points
    4 661
    Par défaut
    Pourrais-tu nous montrer ton code?
    Simulink & Embedded Coder

    Au boulot : Windows 7 , MATLAB r2016b
    A la maison : ArchLinux mais pas MATLAB

  7. #7
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2011
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Décembre 2011
    Messages : 8
    Points : 4
    Points
    4
    Par défaut TMS320DSK6713
    bonjour voici mon code:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    function MotMFCC =MFCCsimulink(MotWav)
    %%%%%%%%%%%%%%% Calcul des MFCC %%%%%%%%%%%%%%%%%%%5
    FS=11025;                          
    FilterPre=1 ;            % Prametre de MFCC
    Amplitude=5;             % Prametre de MFCC
    Deltas=1;
     
              %[MotWav,Fs]=wavread(cheminduMot);
              filteredValues=Amplitude*filter([1],[1 -0.9],MotWav);
              MotMFCC=melcepstBEN(filteredValues,FS,'e0dD')'; % 42 coefficients avec dderive premere et second,pour avoir 12 coefficients il saufi de supprimer 'e0dD'
     
     
     
     
    % la fonction melcepst
    function c=melcepstBEN(s,fs,w)
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %MELCEPST Calculate the mel cepstrum of a signal C=(S,FS,W,NC,P,N,INC,FL,FH)
    %Simple use: c=melcepst(s,fs)  % calculate mel cepstrum with 12 coefs, 256 sample frames
    %            c=melcepst(s,fs,'e0dD')%include log energy, 0th cepstral coef, 
    %                                 delta and delta-delta coefs
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     nc=12; 
     p=floor(3*log(fs));
     n=pow2(floor(log2(0.03*fs))); 
     fh=0.5;   
     fl=0;
     inc=floor(n/2);
     eml.extrinsic('hamming');
    eml.extrinsic('enframe');
    eml.extrinsic('rfft');
    eml.extrinsic('melbankm');
    if nargin<3 w='M'; end     
    if length(w)==0
       w='M';
    end
    if any(w=='R')
       z=enframe(s,n,inc);
    elseif any (w=='N')
       z=enframe(s,hanning(n),inc);
    else
       z=enframe(s,hamming(n),inc);
    end
    f=rfft(z.');
    [m,a,b]=melbankm(p,n,fs,fl,fh,w);
    pw=f(a:b,:).*conj(f(a:b,:));
    pth=max(pw(:))*1E-6;
    if any(w=='p')
       y=log(max(m*pw,pth));
    else
       ath=sqrt(pth);
       y=log(max(m*abs(f(a:b,:)),ath));
    end
    c=rdct(y).';
    nf=size(c,1);
    nc=nc+1;
    if p>nc
       c(:,nc+1:end)=[];
    elseif p<nc
       c=[c zeros(nf,nc-p)];
    end
    if ~any(w=='0')
       c(:,1)=[];
       nc=nc-1;
    end
    if any(w=='e')
       c=[log(sum(pw)).' c];
       nc=nc+1;
    end
     
    % calculate derivative
     
    if any(w=='D')
      vf=(4:-1:-4)/60;
      af=(1:-1:-1)/2;
      ww=ones(5,1);
      cx=[c(ww,:); c; c(nf*ww,:)];
      vx=reshape(filter(vf,1,cx(:)),nf+10,nc);
      vx(1:8,:)=[];
      ax=reshape(filter(af,1,vx(:)),nf+2,nc);
      ax(1:2,:)=[];
      vx([1 nf+2],:)=[];
      if any(w=='d')
         c=[c vx ax];
      else
         c=[c ax];
      end
    elseif any(w=='d')
      vf=(4:-1:-4)/60;
      ww=ones(4,1);
      cx=[c(ww,:); c; c(nf*ww,:)];
      vx=reshape(filter(vf,1,cx(:)),nf+8,nc);
      vx(1:8,:)=[];
      c=[c vx];
    end
     
    if nargout<1
       [nf,nc]=size(c);
       t=((0:nf-1)*inc+(n-1)/2)/fs;
       ci=(1:nc)-any(w=='0')-any(w=='e');
       imh = imagesc(t,ci,c.');
       axis('xy');
       xlabel('Time (s)');
       ylabel('Mel-cepstrum coefficient');
            map = (0:63)'/63;
            colormap([map map map]);
            colorbar;
    end
     
     
    %%la fonction enframe
    function f=enframeBEN(x,win,inc)
     
    nx=length(x);
    nwin=length(win);
       if (nwin == 1)
       len = win;
       else
       len = nwin;
       end
    nf = fix((nx-len+inc)/inc);
    f=zeros(nf,len);
    indf= inc*(0:(nf-1)).';
    inds = (1:len);
    f(:) = x(indf(:,ones(1,len))+inds(ones(nf,1),:));
    if (nwin > 1)
        w = win(:)';
        f = f .* w(ones(nf,1),:);
    end
     
     
    %la fonction rfft
    function y=rfftBEN(x)
    %RFFT     FFT of real data Y=(X,N)
     
      y=fft(x);
      if size(y,1)==1
         m=length(y);
         y(floor((m+4)/2):m)=[];
      else
         m=size(y,1);
         y(floor((m+4)/2):m,:)=[];
      end
     
     
    % la fonction melbanhm
    function [x,mn,mx]=melbankmBEN(p,n,fs,fl,fh,w)
    %MELBANKM determine matrix for a mel-spaced filterbank [X,MN,MX]=(P,N,FS,FL,FH,W)
     
    f0=700/fs;
    fn2=floor(n/2);
    lr=log((f0+fh)/(f0+fl))/(p+1);
    % convert to fft bin numbers with 0 for DC term
    bl=n*((f0+fl)*exp([0 1 p p+1]*lr)-f0);
    b2=ceil(bl(2));
    b3=floor(bl(3));
      b1=floor(bl(1))+1;
      b4=min(fn2,ceil(bl(4)))-1;
      pf=log((f0+(b1:b4)/n)/(f0+fl))/lr;
      fp=floor(pf);
      pm=pf-fp;
      k2=b2-b1+1;
      k3=b3-b1+1;
      k4=b4-b1+1;
      r=[fp(k2:k4) 1+fp(1:k3)];
      c=[k2:k4 1:k3];
      v=2*[1-pm(k2:k4) pm(1:k3)];
      mn=b1+1;
      mx=b4+1;
     
    if any(w=='n')
      v=1-cos(v*pi/2);
    elseif any(w=='m')
      v=1-0.92/1.08*cos(v*pi/2);
    end
    if nargout > 1
      x=sparse(r,c,v);
    else
      x=sparse(r,c+mn-1,v,p,1+fn2);
    end
     
    % la fonction rdct
    function y=rdctBEN(x)
    %RDCT     Discrete cosine transform of real data Y=(X,N)
    fl=size(x,1)==1;
    if fl   x=x(:);   end
    [m,k]=size(x);
    n=m;
    x=[x(1:2:n,:); x(2*fix(n/2):-2:2,:)];
    z=[sqrt(2) 2*exp((-0.5i*pi/n)*(1:n-1))].';
    y=real(fft(x).*z(:,ones(1,k)));
     
    if fl y=y.'; end

  8. #8
    Membre du Club Avatar de 123djimy
    Homme Profil pro
    Inscrit en
    Décembre 2009
    Messages
    36
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Algérie

    Informations professionnelles :
    Secteur : Industrie

    Informations forums :
    Inscription : Décembre 2009
    Messages : 36
    Points : 41
    Points
    41
    Par défaut
    Dans l'Embedded MATLAB tu n'a pas le droit de changer la taille des variables, par exemple:
    ax(1:2,: )=[];
    vx([1 nf+2],: )=[];
    You cannot use variables that change size.

  9. #9
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2011
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Décembre 2011
    Messages : 8
    Points : 4
    Points
    4
    Par défaut TMS320DSK6713
    Citation Envoyé par 123djimy Voir le message
    Dans l'Embedded MATLAB tu n'a pas le droit de changer la taille des variables, par exemple:
    bonjour djimy, j'ai lu ta remarque, mais la question qui se pose:
    -qu'est ce que je dois faire pour regler ce probleme?

  10. #10
    Expert confirmé
    Avatar de duf42
    Homme Profil pro
    Formateur en informatique
    Inscrit en
    Novembre 2007
    Messages
    3 111
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Formateur en informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2007
    Messages : 3 111
    Points : 4 661
    Points
    4 661
    Par défaut
    Pour éviter ce problème, le mieux est de préallouer la mémoire avant d'utiliser tes variables dans Embedded MATLAB: tu crées le tableau avec la taille finale (ou maximum) et ensuite tu le remplis.
    Simulink & Embedded Coder

    Au boulot : Windows 7 , MATLAB r2016b
    A la maison : ArchLinux mais pas MATLAB

  11. #11
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Décembre 2011
    Messages
    8
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : Enseignement

    Informations forums :
    Inscription : Décembre 2011
    Messages : 8
    Points : 4
    Points
    4
    Par défaut DSP 6713
    bonjour a tous,
    je suis en train d'implementer un programe de reconnaissance des mots isolees par les chaine de markov cache sur une carte DSP 6713,j'ai utilise le simulink pour schematiser les etapes de mon algorithme, mon probleme est le suivant:
    - je veux acceder les ports de la daughter card avec le simulink, j'ai pas trouve comment et quelle fonction je doit utiliser.
    merci.

Discussions similaires

  1. Carte à DSP ?
    Par AYDIWALID dans le forum OpenCV
    Réponses: 0
    Dernier message: 22/09/2010, 14h47
  2. comment excuter des codes matlab sur la carte dsp
    Par kadjuv dans le forum MATLAB
    Réponses: 4
    Dernier message: 20/02/2010, 00h35
  3. Driver pour une carte DSP PCI / Mode Utilisateur
    Par rouliaan dans le forum Matériel
    Réponses: 0
    Dernier message: 28/08/2007, 15h00
  4. Réponses: 6
    Dernier message: 09/04/2007, 16h52
  5. Traduire du DSP pour ADSP2181 de Analog Devices en C
    Par Aramis dans le forum Autres architectures
    Réponses: 4
    Dernier message: 14/06/2002, 12h03

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo