Tutorials/k0SDR/Tutorial04a: readWiserdFile.m

File readWiserdFile.m, 675 bytes (added by nilanjan, 9 years ago)
Line 
1function [ samps ] = readWiserdFile( filename , limit = 100000000)
2%UNTITLED Summary of this function goes here
3% Detailed explanation goes here
4 fid = fopen(filename);
5% i = 0;
6% while ~feof(fid)
7% a = fread(fid, 1, 'float32');
8% b = fread(fid, 1, 'float32');
9% if (length(a) == 1) && (length(b) == 1)
10 % i = i + 1;
11% samps(i) = a + b * 1i;;
12% else
13 % length(a)
14 % length(b)
15% end
16% end
17%aa = fread(fid, [2, 100000000], 'float32');
18%ss = fread(fid, [2, 100000000], 'float32');
19ss = fread(fid, [2, limit], 'float32');
20samps = ss(1,:) + 1i .* ss(2,:);
21fclose(fid);
22end