|
Components and Circuits For discussions about component types, alternatives and availability, circuit configurations and modifications etc. Discussions here should be of a general nature and not about specific sets. |
|
Thread Tools |
19th Jun 2018, 8:19 pm | #21 |
Heptode
Join Date: Feb 2010
Location: Duffort, Gers, France
Posts: 714
|
Re: Heavy maths? Sample rates and pitch shifting
If you sample at a fixed frequency then each individual bit will represent progressively longer bits of the original sound as the tape progresses. Fit a polynomial to a few bits within a "window" and slide that window along the file, keeping track of how far you are from the start. Resample within the polynomial according to how large the current frequency shift is. So if e.g. the radius of the tape at the end was half the radius at the start, you need to adjust the sampling points so that they are half as far apart at the end as they were at the beginning and corresponding spacings in between.
Or buy a spool-drive machine.
__________________
Stuart The golden age is always yesterday - Asa Briggs |
19th Jun 2018, 10:47 pm | #22 |
Moderator
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 22,871
|
Re: Heavy maths? Sample rates and pitch shifting
So you don't need just a shift in pitch, the whole timing changes together, so you need to sample the recording, move the timing of the samples to correct for CAV, and then resample at fixed sampling rate and filter to remove aliases (The filter is the interpolator you need and it is stable)
David
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done |
19th Jun 2018, 11:36 pm | #23 |
Dekatron
Join Date: Sep 2005
Location: Seaford, East Sussex, UK.
Posts: 5,997
|
Re: Heavy maths? Sample rates and pitch shifting
This is a CAV digital audio tape that was recorded at a fixed sample rate but when played back on a CSV machine the sample rate changes depending on the position on the tape and therefore the audio speeds up or slows down. You plan to digitally record the audio output from the CSV machine and convert it back to the correct speed.
I still think a simple linear interpolation is all that is needed as you don't have missing samples. At worst this will create some very high harmonics easily filtered out. However, the complication will be in the audio bandwidth of the playback machine which may result in loss of information. |
20th Jun 2018, 7:43 am | #24 |
Moderator
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 22,871
|
Re: Heavy maths? Sample rates and pitch shifting
I agree.
It's a linear drift of all aspects of time. Pitch, syllabic rate etc. all together, That makes it a lot easier to fix David
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done |
20th Jun 2018, 8:56 am | #25 |
Heptode
Join Date: Feb 2010
Location: Duffort, Gers, France
Posts: 714
|
Re: Heavy maths? Sample rates and pitch shifting
Linear is fine if the sampling frequency is much higher (more than 10x) the highest frequency in the audio. For lower frequencies some sort of spline is better. Ubuntu comes with the soundtouch library:
Soundtouch which will probably do everything you need with a bit of luck.
__________________
Stuart The golden age is always yesterday - Asa Briggs |
20th Jun 2018, 10:23 am | #26 |
Hexode
Join Date: Jun 2018
Location: Buckinghamshire, UK.
Posts: 387
|
Re: Heavy maths? Sample rates and pitch shifting
In Audacity 2.2.1 there is effect named 'Sliding Time Scale/Pitch Shift':-
Sliding Time Scale / Pitch Shift... allows you to make a continuous change to the tempo and/or pitch of a selection by choosing initial and/or final change values. Tempo changes made without selecting a pitch change preserve the original pitch, and pitch changes made without selecting a tempo change preserve the original tempo. By changing only one of tempo and pitch and choosing the same initial and final value, you can use Sliding Time Scale / Pitch Shift in the same way as Change Tempo or Change Pitch to produce a high quality fixed change. However Sliding Time Scale / Pitch Shift lets you for example set the initial tempo change to -50% while also setting the final tempo change to +20%, the initial pitch change to +3 semitones and the final pitch change to +1 semitones. Because of the high quality algorithm used, Sliding Time Scale / Pitch Shift is normally slower compared to performing the same effect with Change Tempo or Change Pitch. I haven't tried it, but it might seem applicable ? Cheers . |
20th Jun 2018, 12:19 pm | #27 | |
Dekatron
Join Date: Aug 2003
Location: near Reading (and sometimes Torquay)
Posts: 3,094
|
Re: Heavy maths? Sample rates and pitch shifting
Quote:
Try it and see. |
|
22nd Jun 2018, 9:45 am | #28 |
Hexode
Join Date: Jun 2018
Location: Buckinghamshire, UK.
Posts: 387
|
Re: Heavy maths? Sample rates and pitch shifting
Taking a closer look at Audacity, it turns out there is an even simpler function available which uses a 'timing envelope'.
A Time Track is used in conjunction with one or more audio tracks to progressively increase or decrease playback speed (and pitch) over the length of the audio. Speed changes are controlled by manipulating the blue "time warp" line with the Envelope Tool used for making gradual volume changes. If the blue line is dragged above the horizontal, the audio plays faster; if dragged below, it plays slower. The algorithm is clearly very much simpler, so much so that it allows you to adjust the envelope and play back the result immediately, rather than suffer the lenghy processing time of the scale/pitch effect. So, add a 'time track', set the range of adjustment and a linear scale, and fix the start end end values... listen to the result, adjust to taste - job done! Cheers . |
23rd Jun 2018, 9:14 pm | #29 | |
Octode
Join Date: May 2007
Location: Liss, Hampshire, UK.
Posts: 1,873
|
Re: Heavy maths? Sample rates and pitch shifting
Quote:
https://docs.wixstatic.com/ugd/2aa44...d1390c2067.pdf which explains the idea. The bias signal is probably the best reference but this would require some specialist kit in order to extract it. |
|