Pitch Shifting with changing the temp/speed

  • Thread starter Thread starter btb4198
  • Start date Start date
  • Tags Tags
    Pitch
Click For Summary

Discussion Overview

The discussion revolves around the concept of pitch shifting in audio processing, specifically using white, brown, and pink noise generators. Participants explore how to achieve pitch shifts by manipulating sampling rates and examine the effects of these changes on sound frequencies, particularly in relation to middle C.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant suggests that to shift the pitch up by one octave from middle C, they need to sample at twice the playback speed, using a sampling rate of 88200 Hz while playing a sound sampled at 44100 Hz.
  • Another participant questions whether generating points at 88200 Hz would result in a pitch shift downwards, indicating a potential misunderstanding of the relationship between sampling rates and pitch.
  • A participant reports conducting a test with a sine wave and finds that their results are close to expected frequencies when sampling at 88200 Hz, but notes discrepancies with certain frequencies.
  • There is confusion regarding the implementation of white noise in the pitch shifting process, with a participant expressing difficulty in achieving the desired effect when adding noise to their signal.
  • Participants inquire about the functionality of Audacity's "change pitch without changing tempo" feature, seeking clarification on how it differs from their own attempts.

Areas of Agreement / Disagreement

Participants express uncertainty regarding the effects of sampling rates on pitch shifting, with some proposing different interpretations of the relationship between sampling frequency and perceived pitch. The discussion remains unresolved as participants explore various approaches and outcomes.

Contextual Notes

There are limitations in the understanding of how sampling rates affect pitch, particularly in the context of noise generation and the specific implementation of algorithms. Participants have not reached a consensus on the correct methods or outcomes.

btb4198
Messages
570
Reaction score
10
so I have a white, brown, and pink noise generators and i want to shift the pitch up by one octave (12 semitones) from middle C, I need to sample 2 time as fast as I play the sounds correct ?

so in the c# code for my white noise generator I have it playing at 44100 Hz( the standard) but I am sampling the 88200 Hz
so it would be this :

buffer[n] = Amplitude * (2 * rnd1.NextDouble() - 1) * Math.Sin(Math.PI * Frequency * n2 / 88200D);

and this should work right ?
I have it set to 2 channels and 44100 Hz but I am sampling at 88200 Hz;

so it should move up one Octave from middle C, without changing the speed
is this correct ?
and if I were to sample at 22050Hz I would be move down one octave from middle C?
 
Engineering news on Phys.org
If i play set my wav file to a sampling rate of 44100hz and 2 channels but i generate point using

buffer[n] = Amplitude * (2 * rnd1.NextDouble() - 1) * Math.Sin(Math.PI * Frequency * n2 / 88200D);

88200 hz is 2 time bigger than 44100hz that would be one octave below middle C? so the sound would be lower right? and it pitch shift white noise or pink noise lower after fitler between 2000hz - 500hz you should get thunder right ? is that correct ? or am i just wrong ?
 
ok i just did this test. I removes the noise part and just play a normal sine wave so this:

buffer[n]= (float)(Amplitude * Math.Sin(Math.PI * Frequency * n1 / 88200D));

I set my wave file sampling rate to 44100Hz and channel to 2. so I am sampling 2 times faster and I am playing and it seem to be working : middle C (C4) = 261.6 Hz C3 = 130.8 Hz I played 261.6Hz and I got back 129.199 Hz that is really close. C6 = 1047 Hz i played 1047 Hz and I got back 522.180 Hz C5 = 523.3 Hz also very close G4 = 392.0 Hz G3 = 196.0 hz I played 392.0Hz and I got back 193.7988Hz
that is is off more than the others , but still close right? what do you think? oh I used another program i make to do the listening and that it how I know what Frequency i am getting back .
but it did not work when I added the white noise part. I have tried both : temp3[n] = (Amplitude * Math.Sin(Math.PI * (2 * rnd1.NextDouble() - 1) * n2 / 264600));

and temp3[n] = (Amplitude*(2 * rnd1.NextDouble() - 1) * Math.Sin(Math.PI * Frequency * n2 / 264600));

and I have change 264600Hz to everything I could think of... and it does not work... why? what does Audacity's change Pitch without changing tempo effect does that my does not?
 
anyone?
 

Similar threads

Replies
16
Views
8K
Replies
4
Views
3K
  • · Replies 8 ·
Replies
8
Views
5K
  • · Replies 16 ·
Replies
16
Views
4K
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
460