Reading Binary File Format with complex integer and integer

12 Ansichten (letzte 30 Tage)
Dawid
Dawid am 29 Mär. 2011
The complex SAR image samples are stored as 16 bit / 16 bit complex integer (4 bytes). The byte order is big-endian (most significant byte first (MSB)) All annotation values are stored as 32 bit integer (4 bytes). The filler value is a 32 bit integer with a constant value of hex. 7f7f7f7f. That way, an annotation or filler value requires the same storage size as an image sample.
when I use
fid = fopen('IMAGE_HH_SRA_spot_074.cos', 'r', 'b');
m5 = fread(fid, [8367, 9506], '*uint');
I can get the annotation and filler values but image samples are also 32 bit. Can you help me how I can read 32 and 16 bit complex integer to get proper values?

Antworten (1)

Walter Roberson
Walter Roberson am 29 Mär. 2011
This might be an application for memmapfile
To split a uint32 into uint16 values,
m5s = typecast(m5(:),'uint16');
m5r = reshape(m5s(1:2:end),size(m5));
m5i = reshape(m5s(2:2:end),size(m5));
m5c = complex(m5r, m5i);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by