N is set to 1024 for now.
I calculate the real cepstrum of the voice signal:
v_ceps = real(ifft(log(abs(fft(voice)))));
which I then multiply element-wise with my window:
v_ceps = v_ceps .* win;
transforming this back _should_ give me a smoothed spectrum.
smooth_spec = abs(fft(v_ceps));
The problem is, it doesn't work. The output isn't smooth and it doesn't
look similar to the original voice spectrum. Where did I go wrong?
I can't see any error in the algorithm nor the implementation.
Roman
PS: if you know any other good algortithms for spectral smoothing
(constant bandwidth preferred), go right ahead! :-)
Roman Katzer wrote:
> I'm trying to write a function for spectral smoothing using the signal's
> cepstrum in Matlab.
>
> Here's what I have:
>
> voice - a voice signal, 8192 samples long
> win - a right window, 8192 samples long, with a variable cutoff:
>
> 1 |_____________
> | \
> | \
> | \
> 0 |_________________\____________________
> 1 N 8192
>
>
> N is set to 1024 for now.
> I calculate the real cepstrum of the voice signal:
>
> v_ceps = real(ifft(log(abs(fft(voice)))));
>
> which I then multiply element-wise with my window:
>
> v_ceps = v_ceps .* win;
>
> transforming this back _should_ give me a smoothed spectrum.
>
> smooth_spec = abs(fft(v_ceps));
>
> The problem is, it doesn't work. The output isn't smooth and it doesn't
> look similar to the original voice spectrum. Where did I go wrong?
> I can't see any error in the algorithm nor the implementation.
>
> Roman
>
>
> PS: if you know any other good algortithms for spectral smoothing
> (constant bandwidth preferred), go right ahead! :-)
Roman:
I think the convolution should be something like this:
"Roman Katzer" <[email protected]> wrote in message
news[email protected]..
> I'm trying to write a function for spectral smoothing using the signal's
> cepstrum in Matlab.
>
> Here's what I have:
>
> voice - a voice signal, 8192 samples long
> win - a right window, 8192 samples long, with a variable cutoff:
>
> 1 |_____________
> | \
> | \
> | \
> 0 |_________________\____________________
> 1 N 8192
>
>
> N is set to 1024 for now.
> I calculate the real cepstrum of the voice signal:
>
> v_ceps = real(ifft(log(abs(fft(voice)))));
>
> which I then multiply element-wise with my window:
>
> v_ceps = v_ceps .* win;
>
> transforming this back _should_ give me a smoothed spectrum.
>
> smooth_spec = abs(fft(v_ceps));
>
> The problem is, it doesn't work. The output isn't smooth and it doesn't
> look similar to the original voice spectrum. Where did I go wrong?
> I can't see any error in the algorithm nor the implementation.
>
> Roman
Roman Katzer <[email protected]> wrote in message news:<[email protected]>. ..
> I'm trying to write a function for spectral smoothing using the signal's
> cepstrum in Matlab.
>
> Here's what I have:
>
> voice - a voice signal, 8192 samples long
> win - a right window, 8192 samples long, with a variable cutoff:
>
> 1 |_____________
> | \
> | \
> | \
> 0 |_________________\____________________
> 1 N 8192
>
>
> N is set to 1024 for now.
> I calculate the real cepstrum of the voice signal:
>
> v_ceps = real(ifft(log(abs(fft(voice)))));
>
> which I then multiply element-wise with my window:
>
> v_ceps = v_ceps .* win;
>
> transforming this back _should_ give me a smoothed spectrum.
>
> smooth_spec = abs(fft(v_ceps));
>
> The problem is, it doesn't work. The output isn't smooth and it doesn't
> look similar to the original voice spectrum. Where did I go wrong?
> I can't see any error in the algorithm nor the implementation.
>
> Roman
>
>
> PS: if you know any other good algortithms for spectral smoothing
> (constant bandwidth preferred), go right ahead! :-)
The problem is that you are ignoring the negative frequencies in the
spectrum. Your window should be as follows
"Roman Katzer" <[email protected]> wrote in message
news[email protected]..
> I'm trying to write a function for spectral smoothing using the signal's
> cepstrum in Matlab.
>
> Here's what I have:
>
> voice - a voice signal, 8192 samples long
> win - a right window, 8192 samples long, with a variable cutoff:
>
> 1 |_____________
> | \
> | \
> | \
> 0 |_________________\____________________
> 1 N 8192
>
>
> N is set to 1024 for now.
> I calculate the real cepstrum of the voice signal:
>
> v_ceps = real(ifft(log(abs(fft(voice)))));
>
> which I then multiply element-wise with my window:
>
> v_ceps = v_ceps .* win;
>
> transforming this back _should_ give me a smoothed spectrum.
>
> smooth_spec = abs(fft(v_ceps));
This is not the inverse cepstrum.
Dirk
>
> The problem is, it doesn't work. The output isn't smooth and it doesn't
> look similar to the original voice spectrum. Where did I go wrong?
> I can't see any error in the algorithm nor the implementation.
>
> Roman
>
>
> PS: if you know any other good algortithms for spectral smoothing
> (constant bandwidth preferred), go right ahead! :-)
"Roman Katzer" <[email protected]> wrote in message
news:[email protected]..
> Hi Fred,
>
> On Wed, 6 Aug 2003 21:00:44 -0700, Fred Marshall wrote:
> >What is a "right window"?
>
> maybe my terminology is misleading. I mean the right half of a (hann)
> window, appended to a sequence of ones and followed by a sequence of
> zeros. It looks close to something like what I tried to show with ASCII
> characters below:
>
> >> win - a right window, 8192 samples long, with a variable cutoff:
> >>
> >> 1 |_____________
> >> | \
> >> | \
> >> | \
> >> 0 |_________________\____________________
> >> 1 N 8192
>
> Roman
The ifft will produce a complete sequence up to the equivalent sample time
epoch (equivalent to sampling frequency).
It repeats at T/2 (like fs/2). So, the filter need to be symmetric about
T/2 like this:
Roman Katzer <[email protected]> wrote in message news:<[email protected]>. ..
> Thank you Mahesh,
>
> I found a solution to my problem. I forgot two things:
> a) I need a symmetric window
> b) I need to exp(.) the real output of the second fft
>
I just assumed that you were doing exp(.) naturally