- refactored

This commit is contained in:
2022-06-30 13:32:40 +02:00
parent 77cd5261b1
commit 776932e5d1
144 changed files with 0 additions and 38 deletions
+17
View File
@@ -0,0 +1,17 @@
% function y = dat2wav(name, fa, nBits, ampthresh)
%
function y = dat2wav(name, fa, nBits, ampthresh)
datfile = sprintf('%s.dat', name);
wavfile = sprintf('%s.wav', name);
fid = fopen(datfile,'r');
data_float = fread(fid, 'float32');
fclose(fid);
a = max(abs(data_float));
ks = ampthresh/a;
data = (2^(nBits-1))*ks*data_float;
wavw16(data,fa,wavfile);