calculate SNR and watch a binary file
Rob Mahurin
rob at utk.edu
Fri Mar 27 13:27:06 CDT 2009
On Mar 26, 2009, at 6:18 PM, Markus Feldmann wrote:
> Rob Mahurin schrieb:
>> These files came from some analog-to-digital converter? If you look
>> at them with hexdump, there is stuff that looks like data only in the
>> first 200 bytes or so. The rest of the file looks likes zeros and
>> the occasional 0x80bf. I wouldn't expect the data read from these
>> files to have a meaningful Fourier transform.
>>
>> Cheers,
>> Rob
>>
> The data can be watched with my method, but not be plotted.
> I do not know how to collect the complex values and bits ?
>
> Ok, here is a clipping from the data at the beginning:
> 0 + 0i
> 0 + 0i
> -1 + 0i
> 0 - 1i
> -13 + 2i
> 65 - 32i
> -183 + 98i
> 412 - 233i
> -831 + 478i
> 1572 - 918i
> -3050 + 1745i
> 8314 - 4139i
> -12548 - 5491i
> 3899 + 10329i
> 3523 - 2748i
> -1791 + 1379i
> 951 - 738i
> -484 + 378i
> 219 - 176i
> -84 + 69i
> 19 - 20i
> 0 + 0i
> 0 - 1i
> 0 + 0i
> 0 - 1i
> 0 + 0i
> 0 - 1i
> 0 + 0i
> 0 + 0i
> 0 + 0i
> 0 + 0i
This is a plausible decoding of your data file. To plot just the
real or imaginary part of a vector v, do plot(real(v)) or plot(imag
(v)). plot(v) will show points in the complex plane.
If these are already Fourier components, plot( abs(v).^2 ) will show
your power spectrum. There is a broad peak centered around the 15th
frequency bin.
If this is supposed to look like a sine wave, you have made a mistake
I don't understand.
Cheers,
Rob
--
Rob Mahurin
Department of Physics and Astronomy
University of Tennessee 865 207 2594
Knoxville, TN 37996 rob at utk.edu
More information about the Help-octave
mailing list