› Forums › Foundations of speech › Signal processing › Phase Shift Query
- This topic has 8 replies, 3 voices, and was last updated 3 years, 10 months ago by Simon.
-
AuthorPosts
-
-
September 28, 2020 at 09:02 #12028
In the sampling tutorial, there is this section and I am struggling to understand what it means:
We can apply a phase shift of 𝜙 radians to sin(𝑡) to gives us a sine wave of the form: sin(𝜃+𝜙) . It basically means we start our cycles around the unit circle at 𝑒𝑖𝜙 instead of at 𝑒𝑖0=1+𝑖0=(1,0)
Where would a unit circle plotted at 𝑒𝑖𝜙 be centred as opposed to one plotted at 𝑒𝑖0=1+𝑖0=(1,0)? Probably missing something really obvious here. Thanks -
September 28, 2020 at 11:21 #12031
sp-m1-3-sampling-sinusoids notebook, section Magnitude and Phase Modifications
The unit circle is always centred at the origin (0,0).
A sinusoid with no phase shift starts on the unit circle at co-ordinates (1,0).
A sinusoid with a phase shift starts somewhere else on the same unit circle. The amount of phase shift specifies how far around the unit circle that starting point is. For example, a phase shift of pi/2 radians would mean moving that far around the unit circle and thus starting at (0,1).
-
September 28, 2020 at 13:36 #12033
Having read through the rest of the tutorials, I still don’t understand why the phase shift is a necessary component of the Fourier transform. I know it’s a pretty basic component of it but can’t seem to wrap my head around it. Do we phase shift to make sure that the phasor moves around the unit circle at the right frequency?
-
September 28, 2020 at 19:49 #12049
We basically need the phase angle from the DFT if we want to reconstruct the original input signal from the DFT outputs. Each DFT output tells us how to scale (magnitude) and shift (phase) the cosine wave with the frequency associated with each DFT output. Once we scale and shift these cosine waves with the DFT magnitudes and phases, we can recreate the original input signal as it was (with some limitations!).
You can use the code in sp-m1-3-sampling-sinusoids.ipynb (‘Generating linear combinations of sinusoids’) to play with this a bit and also to see why you’ll need phase information to recreate the original input. If you change the params variable there to:
params = [(1, 2, 0), (1, 6, 0)]
You’ll generate a waveform made up of a 2 Hz sine wave and a 6 Hz sine wave, both with peak amplitude 1 and no phase shift.
If you compare this to the version where we apply a phase shift of pi/3 radians to the 6 Hz component:
params = [(1, 2, 0), (1, 6, np.pi/3)]
You see a somewhat different compound waveform. So, if we want to recover the latter example from the DFT, we need the phase information for the frequency components we identify as being present in the original signal. Otherwise we won’t get back the input. You can also change the params variable in the notebook to check that a cosine wave is the same as a sine wave shifted by pi/2 radians.
So, we can think of the phase output of the DFT to be independent of the frequency associated with that output.
That said, actually it’s not that clear that you need phase information for doing tasks like automatic speech recognition where we’re mainly interested in the which frequency components are present in a signal, not whether we can reconstruct them. For this reason we often just focus on the magnitude spectrum for actual applications and ignore the phase spectrum!
-
September 28, 2020 at 20:06 #12051
The video Frequency domain will help you understand why phase is less important than magnitude, for human perception, and for speech technology.
-
September 29, 2020 at 08:52 #12054
Might be a bad analogy, but could you compare it to a recipe? As in if we don’t get the information about the time each ingredient was added (phase) we won’t reconstruct the original recipe (some waves waves might cancel each other out if we don’t phase shift)? Also, am I correct in thinking that a phase shift is equivalent to a time shift, because if the phase angle is shifted backwards, we will reach the end of that cycle at a later point.
Thanks -
September 29, 2020 at 10:13 #12055
I like your recipe analogy – let’s try using it: If we construct a recipe using the wrong phase, we’ll use the correct ingredients (i.e., sinusoids with the correct magnitudes), but in the wrong relationship to each other.
On the left of the attached picture (you may need to be logged in to see it) is a cake constructed with the correct phases of all the ingredients. On the right, the same ingredients with the wrong phases. Close your eyes and they will taste the same, but they look very different.
Note that the sinusoid basis functions in Fourier analysis can never cancel each other out though – because they are orthogonal.
Attachments:
You must be logged in to view attached files. -
September 29, 2020 at 11:01 #12057
So it is kind of like how two different sounds with different phases can show up the same on a magnitude spectrum – the sounds are still different structurally, but on a surface level we hear them the same because our hearing cannot make this distinction
-
September 29, 2020 at 11:37 #12058
Yes, that’s right. In that case, the waveforms will look different, but (in general) we will not hear any difference.
-
-
AuthorPosts
- You must be logged in to reply to this topic.