Should allocate pulse(1:3*nsps), not pulse(1:3*nsps*fsample) !

This commit is contained in:
Joe Taylor 2020-06-19 19:17:05 -04:00
parent 28746dd0b6
commit f2b460231b
2 changed files with 4 additions and 30 deletions

View File

@ -13,10 +13,8 @@ subroutine gen_fst280wave(itone,nsym,nsps,nwave,fsample,hmod,f0, &
save first,twopi,dt,tsym,nsps0
if(first.or.nsps.ne.nsps0) then
if(allocated(pulse)) then
deallocate(pulse)
endif
allocate(pulse(3*nsps*int(fsample)))
if(allocated(pulse)) deallocate(pulse)
allocate(pulse(1:3*nsps))
twopi=8.0*atan(1.0)
dt=1.0/fsample
tsym=nsps/fsample
@ -42,7 +40,7 @@ subroutine gen_fst280wave(itone,nsym,nsps,nwave,fsample,hmod,f0, &
! Calculate and insert the audio waveform
phi=0.0
dphi = dphi + twopi*(f0-1.5*hmod/tsym)*dt !Shift frequency up by f0
dphi = dphi + twopi*(f0-1.5*hmod/tsym)*dt !Shift frequency up by f0
if(icmplx.eq.0) wave=0.
if(icmplx.eq.1) cwave=0.
k=0

View File

@ -15,7 +15,7 @@ subroutine foxgen()
! common block.
parameter (NN=79,ND=58,NSPS=4*1920)
parameter (NWAVE=NN*NSPS,NFFT=614400,NH=NFFT/2)
parameter (NWAVE=14278656,NFFT=614400,NH=NFFT/2)
character*40 cmsg
character*37 msg,msgsent
integer itone(79)
@ -60,34 +60,10 @@ subroutine foxgen()
peak1=maxval(abs(wave))
wave=wave/peak1
! call plotspec(1,wave) !Plot the spectrum
! Apply compression
! rms=sqrt(dot_product(wave,wave)/kz)
! wave=wave/rms
! do i=1,NWAVE
! wave(i)=h1(wave(i))
! enddo
! peak2=maxval(abs(wave))
! wave=wave/peak2
! call plotspec(2,wave) !Plot the spectrum
width=50.0
call foxfilt(nslots,nfreq,width,wave)
peak3=maxval(abs(wave))
wave=wave/peak3
! nadd=1000
! j=0
! do i=1,NWAVE,nadd
! sx=dot_product(wave(i:i+nadd-1),wave(i:i+nadd-1))
! j=j+1
! write(30,3001) j,sx/nadd
!3001 format(i8,f12.6)
! enddo
! call plotspec(3,wave) !Plot the spectrum
return
end subroutine foxgen