Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform


Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Comp.DSP | How to load datum produced by Matlab to CCS?


There are 2 messages in this thread.

You are currently looking at messages 0 to 2.


How to load datum produced by Matlab to CCS? - peter@mir.knu.ac.kr - 2004-10-01 02:15:00

I have designed a FIR filter by Matlab, and saved the filer
coefficients as a data file.
   I want to utilize these coefficients on 6711DSK board to do some
calculation.
   But when I load the coefficient data file to CCS,CCS showed the
data file can not be open.
   I don't know why 
   I am always expecting your answer.


3x
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: How to load datum produced by Matlab to CCS? - John Sampson - 2004-10-02 13:11:00



p...@mir.knu.ac.kr (p...@mir.knu.ac.kr) wrote in message
news:<9...@posting.google.com>...
> I have designed a FIR filter by Matlab, and saved the filer
> coefficients as a data file.
>    I want to utilize these coefficients on 6711DSK board to do some
> calculation.
>    But when I load the coefficient data file to CCS,CCS showed the
> data file can not be open.
>    I don't know why 
>    I am always expecting your answer.
> 
> 
> 3x

CCS for the '54X has a specific text format that it expects the data to
be arranged in. The first line must contain a magic number and a length,
if I remember correctly. The format is the same as what you get in saving
memory to a file. It should be documented in the online help.

Alternatively, you can write a simple m-file to write out a .c file that declares
an intialized array, and add that file to your project. I always use this method.

Here is some sample matlab code:

function stat = csave(c,vname,hdr1,hdr2,fname)

    format long;
    fid = fopen(fname,'wt');
    fprintf(fid,hdr1);
    fprintf(fid,'\n\n');
    fprintf(fid,hdr2);
    fprintf(fid,sprintf('\n\n#define\tN%s\t%d\n',upper(vname),length(c)));
    fprintf(fid,sprintf('\nconst WORD %s[N%s] = {\n',vname,upper(vname)));
	for m=1:(length(c)-1)
        fprintf(fid,'\t%d,\n',c(m));
	end
	fprintf(fid,'\t%d\n',c(end));				% no comma
	fprintf(fid,'};\n');

	stat=fclose(fid);
   
return



Hope this is helpful.

John
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.