How to apply 90 degrees phase shift to a voice signal.?
42 views (last 30 days)
Show older comments
Dear all,
I have a voice signal a. Lets say its a sine with x Hz.
Length and sampling frequency are writen below:
fs = 100000; % Sampling frequency
T = 1/fs; % Sample time
L = 100000; % Length of signal
t = (0:L-1)*T; % Time vector (s)
Here is the FFT of this signal in Hertz
NFFT = 2^nextpow2(L);
ff = fs/2*linspace(0,1,NFFT/2+1);
A = fft(a,NFFT)/L;
plot(ff,2*abs(A(1:NFFT/2+1)));xlabel('freq (Hz)');
ylabel('|A(f)| ');grid
How can we apply a 90 degrees phase shift to this signal-a? Actually, we can estimate its type, frequency and amplitude by plotting it in time and freq. domain and then we can write it as something(2*pi*x*t). Then of course, shifted wave will become something(2*pi*x*t+pi/2). But we need a code that directly shift its phase 90 degrees.
Best regards Dave
1 Comment
Walter Roberson
on 26 Mar 2013
Edited: Walter Roberson
on 26 Mar 2013
Multiply the complex frequency entries by (1 + pi/2*i) ?
Accepted Answer
Wayne King
on 26 Mar 2013
Edited: Wayne King
on 26 Mar 2013
If you have the Signal Processing Toolbox, you can use hilbert() to obtain the analytic signal and use the imaginary part.
n = 0:159;
x = cos(pi/4*n);
y = hilbert(x);
plot(n,x,'b'); hold on;
plot(n,imag(y),'r');
Note that with a frequency of pi/4 radians/sample, a phase shift of pi/2 is 2 samples, which is exactly what you get in imag(y).
More Answers (0)
See Also
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!