Merged master 8748
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,44 @@
|
||||
subroutine wsprcpm_wav(baud,xdt,h,f0,itone,snrdb,iwave)
|
||||
|
||||
! Generate iwave() from itone().
|
||||
|
||||
include 'wsprcpm_params.f90'
|
||||
parameter (NMAX=120*12000)
|
||||
integer itone(NN)
|
||||
integer*2 iwave(NMAX)
|
||||
real*8 twopi,dt,dphi0,dphi1,dphi,phi
|
||||
real dat(NMAX)
|
||||
|
||||
twopi=8.d0*atan(1.d0)
|
||||
dt=1.d0/12000.d0
|
||||
|
||||
dat=0.
|
||||
if(snrdb.lt.90) then
|
||||
do i=1,NMAX
|
||||
dat(i)=gran() !Generate gaussian noise
|
||||
enddo
|
||||
bandwidth_ratio=2500.0/6000.0
|
||||
sig=sqrt(2*bandwidth_ratio)*10.0**(0.05*snrdb)
|
||||
else
|
||||
sig=1.0
|
||||
endif
|
||||
|
||||
phi=0.d0
|
||||
k=nint(xdt/dt)
|
||||
do j=1,NN
|
||||
dphi=twopi*(f0+itone(j)*(h/2.0d0)*baud)*dt
|
||||
do i=1,NSPS0
|
||||
k=k+1
|
||||
phi=phi+dphi
|
||||
if(phi.gt.twopi) phi=phi-twopi
|
||||
xphi=phi
|
||||
if(k.gt.0 .and. k.le.NMAX) dat(k)=dat(k) + sig*sin(xphi)
|
||||
enddo
|
||||
enddo
|
||||
fac=32767.0
|
||||
rms=100.0
|
||||
if(snrdb.ge.90.0) iwave=nint(fac*dat)
|
||||
if(snrdb.lt.90.0) iwave=nint(rms*dat)
|
||||
|
||||
return
|
||||
end subroutine wsprcpm_wav
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/opt/local/bin/octave -qf
|
||||
# read a parity check matrix produced by the peg algorithm and
|
||||
# convert to alist format so that it can be read using alist_to_pcheck
|
||||
arg_list=argv();
|
||||
filename=arg_list{1};
|
||||
fid=fopen(filename,"r");
|
||||
N=fscanf(fid,"%d",[1]);
|
||||
M=fscanf(fid,"%d",[1]);
|
||||
pcheck=zeros(M,N);
|
||||
max_bits_in_check=fscanf(fid,"%d",[1]);
|
||||
for i=1:M
|
||||
vec=fscanf(fid,"%d",[max_bits_in_check]);
|
||||
pcheck(i,vec(vec>0))=1;
|
||||
endfor
|
||||
|
||||
max_bits_in_check2=max(sum(pcheck'));
|
||||
max_checks_per_bit=max(sum(pcheck));
|
||||
printf("%d %d\n",M,N);
|
||||
printf("%d %d\n",max_bits_in_check2,max_checks_per_bit);
|
||||
printf("%d ",sum(pcheck'));
|
||||
printf("\n");
|
||||
printf("%d ",sum(pcheck));
|
||||
printf("\n");
|
||||
for i=1:M
|
||||
vec=find(pcheck(i,:)>0);
|
||||
pr=zeros(1,max_bits_in_check2);
|
||||
pr(1:size(vec)(2))=vec;
|
||||
printf("%d ",pr);
|
||||
printf("\n");
|
||||
endfor
|
||||
for i=1:N
|
||||
vec=find(pcheck(:,i)>0);
|
||||
pr=zeros(1,max_checks_per_bit);
|
||||
pr(1:size(vec)(1))=vec;
|
||||
printf("%d ",pr)
|
||||
printf("\n");
|
||||
endfor
|
||||
Reference in New Issue
Block a user