Here is a utility to change the sample rate stored in a .WAV
header.
And yes, the date on the files is genuine, it really was written in 1999
! I've included the PowerBasic source code for
interest. Run from a CMD prompt.
I've just tested it with a file containing a 300Hz tone at 3000Hz sampling
rate, speeded up to 12000Hz / 1200Hz audio.
SndRec32 and Gram (the latter
in analyze file mode) both were happy with the original 3kHz sampling rate
so windows and the sound card can cope with this non-standard value.
The way windows seems to cope with different sample rates, it appears to
always work with multiples of 300Hz - which explains why 11025Hz often ends up
at 11100Hz (1.0068 times higher - recognise that number WSJT users?) so its
worth keeping with 3000, 6000 etc at the slow side.
Andy G4JNT
On 22 September 2012 11:23, Andy Talbot <andy.g4jnt@...>
wrote:
There may be another way to use SlowWSPR using simple sound record and playback tools and a wav file editing facility. The technique is based around .WAV files and changing the sample rate stored in the header. My understanding is that SlowWSPR uses 1/4 or 1/8 the frequency spacing with a corresponding reduction in the symbol rate - ie both go together so after making allowance for the audio tones, changing the sampling rate will give teh correct symbol / spacing changeFirst save a complete SlowWSPR transmission, recorded at an audio frequency of 1500/4 = 375Hz or 1500/8 = 187.5Hz and a suitable sampling rate - like 6000 or 12000 S/s. Then edit the wav file header using a suitable tool (I'll come to that shortly) so it appears to have been sampled at 24000 or 48000Hz or whatever. This will then replay at standard WSPR spacing and symbol rate - at a proportionately higher audio centre frequency -and can be decoded with the WSPR software.Transmission reverses the process, slowing down the wav file.Sample rate is stored in the .WAV file header as a 32 bit number. The portion of listing below (in the Basic programming language, so variable types are defined by their suffix) shows how the various parameters are extracted from a .WAV file header. Changing the sampe rate involves putting appropriate values into the SampleRate& field. To be strictly accurate, the BytePerSec& ought to be changed as well, but in practice this often isn't necessary - try it and see.I haven't tried this, but many years ago I did speed up wav files by a huge factor to listen to HF ionospheric Doppler. However, these were synthetic .WAV files generated from VERY slow samples (just a few Hz sampling rate) then speeded up 1000 times by the simple process of making the header info any value I wanted. It worked fine, and the sounds of ionospheric Doppler shift from teh carriers of distant broadcast signals recorded over a several hour period then speeded up to a few seconds were wonderful to listen to. The nearest I can explain is that teh saound was a bit like that of whales.The software to do that is lost in the mists of time (needing the Motorola 56003EVm to sample and generate data for the raw file, and all done with G3PLX's help) but there is no reason a fully PC / Sopundcard based solution couldn't be made to do the same job.Andy G4JNTReading bits of a .wav header' in the Basic language, suffix % = 16 bit int, & = 32 bit int, $ = stringopen "b" , 1 , wavfile$
get 1 , 16 , size& 'Size of file
get 1 , 24 , SampleRate&get 1 , 34 , BitsPerSample%
get 1 , 40 , SizeOfData&
get 1 , 22 , channels% 'in case its in stereo
get 1 , 28 , BytesPerSec& 'bytes / playing time
get 1 , 32 , BytesPerSample%
do
seek 1 , thisloc&
get$ 1 , 4 , d$
incr thisloc&
loop until ucase$(d$) = "DATA" or eof(1)
get 1 ,, SizeOfData&
'now positioned at start of dataWriting a complete .wav header (for mono data)open "b" , 2 , wavyfile$
riff$ = "RIFF" : put$ 2 , riff$
chunk& = records& * 2 + 36 : put 2 ,, chunk&
wave$ = "WAVE" : put$ 2 , wave$
fmt$ = "fmt " : put$ 2 , fmt$
size& = 16 : put 2 , 16 , size&
equals1% = 1 : put 2 , 20 , equals1%
channels% = 1 : put 2 , 22 , channels%
samplerate& = srate& : put 2 , 24 , samplerate&
BytesPerSec& = srate& * 2 * channels% : put 2 , 28 , BytesPerSec&
BytesPerSample% = 2: put 2 , 32 , BytesPerSample%
BitsPerSample% = 16 : put 2 , 34 , BitsperSample%
seek 2 , 36
d$ = "data" : put$ 2 , d$
SizeOfData& = records& * 2put 2 ,, SizeOfData&' Start storing the 16 bit samples...