Audio Processing: Matlab vs floating-point c implementation

Gast #253186
Hello,

i've some questions about implementing my source code (which is
simulated in matlab) on DSP (ADSP-21364 with Visual DSP++ 4.0).

In Matlab i had developed some source code which manipulates data from
wave-file (so data points are in a intervall of [-1,1])  - target is:
code should make a hilbert transform of incoming signal.

so my thought was:

- simulate code in matlab with pcm data (works fine)
- develop an equal c-code - test it with MS VC++ (also with PCM data -
works fine - have a look at bottom c-code)
- implement this c-code on DSP-board (doesn't work)

but it doesn't work ;-(

i have an talkthrough  application where i insert the code.
if i load the code on DSP -i have much distortions (overamplify and/or
not same data types at calculation?)

so, please help me...

what is the best way to convert the code so that it will fit the
different data types (PCM vs codec data )...

the codec gives the samples in integer format [-32768,+32767] -am i
right?
if there are some multiplikations in code (let say with a sin(x)) there
will be points which were at limits of integer-type?! (so i have to make
a floating point casting?)

are ther some ways to convert the data types - let say
[-32768,+32767] <--> [-1,1]

i thank you for every hint to make it work!

greetings

9nine9

antworten können auch auf deutsch geschrieben werden!

Vielen Dank!
Angehängte Dateien:

Antwort schreiben

Eine eigene Frage? Dieser Thread ist über 21 Jahre alt. Stell sie in einem eigenen Thread – dort lesen mehr Leute mit, und sie wird öfter und schneller beantwortet.

Neuen Thread starten

Eine Lösung, Ergänzung oder Rückmeldung zu diesem Thread? Dann antworte hier.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.