DSPRelated.com
Forums

Possible to predict phase in a spectrogram?

Started by ssndk March 14, 2006
Hi!

I was just wondering.. is it possible to predict a phase at a single point
in the spectrogram if only that point is missing? both phase and absolute
value is know for all other points...

Regards,
Soren
ssndk wrote:
> Hi! > > I was just wondering.. is it possible to predict a phase at a single point > in the spectrogram if only that point is missing? both phase and absolute > value is know for all other points...
As far as I know, "phase" and "spectrogram" aren't usually associated with one another. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
ssndk wrote:
> I was just wondering.. is it possible to predict a phase at a single point > in the spectrogram if only that point is missing? both phase and absolute > value is know for all other points...
Do you know anything about the signal which produced the phase spectrogram? How many points of the spectrogram do you have? Are there other constraints which would prevent you from reconstructing a legal signal from any arbitrary and complete phase spectrogram? IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
> > I was just wondering.. is it possible to predict a phase at a single point > in the spectrogram if only that point is missing? both phase and absolute > value is know for all other points... >
If only one point is missing then it probably doesn't matter what phase you assign to that point?
ssndk wrote:
> Hi! > > I was just wondering.. is it possible to predict a phase at a single point > in the spectrogram if only that point is missing? both phase and absolute > value is know for all other points...
Usually, the spectrogram displays a time sequence of spectrum magnitude estimates (see for example http://en.wikipedia.org/wiki/Spectrogram). The phase information from the comlex spectrum is not represented. Do you have a time sequence of (phase and magnitude) spectrum estimates (ie. several frames) from which one phase coordinate in one frame is missing, or do you have a single (phase and magnitude) spectrum frame? In the first case, you can interpolate the phase sequence in the "bin" (coordinate) from which one point is missing. This is kind of obvious, so I guess you mean the second case. Here you can only infer something about a missing phase if it is correlated with the other data. In general, this won't be so, there is nothing you can do. Your case might not be general, however. Regards, Andor
>ssndk wrote: >> Hi! >> >> I was just wondering.. is it possible to predict a phase at a single
point
>> in the spectrogram if only that point is missing? both phase and
absolute
>> value is know for all other points... > >Usually, the spectrogram displays a time sequence of spectrum magnitude >estimates (see for example http://en.wikipedia.org/wiki/Spectrogram). >The phase information from the comlex spectrum is not represented. > >Do you have a time sequence of (phase and magnitude) spectrum estimates >(ie. several frames) from which one phase coordinate in one frame is >missing, or do you have a single (phase and magnitude) spectrum frame? > >In the first case, you can interpolate the phase sequence in the "bin" >(coordinate) from which one point is missing. This is kind of obvious, >so I guess you mean the second case. Here you can only infer something >about a missing phase if it is correlated with the other data. In >general, this won't be so, there is nothing you can do. Your case might >not be general, however. > >Regards, >Andor > >
Yes, I was a bit unclear in my question. By spectrogram I really meant a short time fourier transform using a window. So lets say I have 50 frames each consisting of a 512 point FFT, with a 50% overlap (or more). So each frame would consist of the complex values of the FFT. The spectrogram would be the magnitude only. Yes, Interpolation seems obvious if we are talking about a single complex point missing. But what if several points are missing, not just a point, but like a circle or square. Could it be possible to "calculate" the phase (only the phase) from the frames next to, or before the frame that are missing a point at some frequency? I thought maybe the overlap would give some correlation that would make it possible to calculate.. Thanks for your thoughts! Soren
I should maybe also say that the signal is a speech signal.

Thanks,
Soren
ssndk wrote:
...
> Yes, I was a bit unclear in my question. By spectrogram I really meant a > short time fourier transform using a window. So lets say I have 50 frames > each consisting of a 512 point FFT, with a 50% overlap (or more). So each > frame would consist of the complex values of the FFT. The spectrogram > would be the magnitude only. > > Yes, Interpolation seems obvious if we are talking about a single complex > point missing. But what if several points are missing, not just a point, > but like a circle or square. Could it be possible to "calculate" the phase > (only the phase) from the frames next to, or before the frame that are > missing a point at some frequency?
I don't know what you mean by circle or square missing points. But let's assume for the moment, that you are analysing a sampled, periodic signal. Further, let p_{n,k} denote the phase of frame n and bin k (do you understand what I mean by "frame" and "bin"?). For the periodic signal, one phase value p_{n,k} determines the phases for all other frames p_{n+m,k}, simply by p_{n+m,k} = (p_{n,k} + m N k / M) modulo 2 pi (1) where N = frame hop time (measured in samples) and M = frame length (measured in samples) (equation (1) might be wrong, please check the maths). So if you know p_{n+1,k} you can determine p_{n,k} from equation (1). For speech signals (with additive noise), you can assume local stationarity of phase in voiced sections. A least-squares estimate for p_{n,k} is simply the average of the values you get by estimating p_{n,k} from p_{n-1,k} and from p_{n+1,k}. Estimating missing phase might be more difficult (impossible) in unvoiced sections (where the phase is esentially random). FWIW. Regards, Andor
> I thought maybe the overlap would give some correlation that would make it > possible to calculate.. > > Thanks for your thoughts! > Soren
> Yes, Interpolation seems obvious if we are talking about a single complex > point missing. But what if several points are missing, not just a point, > but like a circle or square. Could it be possible to "calculate" the phase > (only the phase) from the frames next to, or before the frame that are > missing a point at some frequency? > I thought maybe the overlap would give some correlation that would make it > possible to calculate..
I don't understand what you mean by "circle or square"....and the term "missing" seems strange.....what do you mean by "missing"? Are you working with noisy speech phases and trying to predict what the original phase is? In that case, I wish you good luck.
Ok, by circle or square i meant missing values in a square or circle
pattern if you look at the STFT matrix. I just wanted to emphasise that
not only one point could be missing, but several bins (i think we mean the
same) in frames next to each other could be missing. In those cases, simple
interpolation is difficult/impossible. I wasn't sure on how the phase
behaved through voiced / unvoiced segments, so your input was a great
help! 

So basically my assumption that the phase could be calculated/estimated
maybe was right, but only in voiced segments, because of the periodicity..
it all seems clear suddently :) .. thanks alot!  I'll try it and see if
gives good results in voiced sections.

Regards,
Soren


>ssndk wrote: >... >> Yes, I was a bit unclear in my question. By spectrogram I really meant
a
>> short time fourier transform using a window. So lets say I have 50
frames
>> each consisting of a 512 point FFT, with a 50% overlap (or more). So
each
>> frame would consist of the complex values of the FFT. The spectrogram >> would be the magnitude only. >> >> Yes, Interpolation seems obvious if we are talking about a single
complex
>> point missing. But what if several points are missing, not just a
point,
>> but like a circle or square. Could it be possible to "calculate" the
phase
>> (only the phase) from the frames next to, or before the frame that are >> missing a point at some frequency? > >I don't know what you mean by circle or square missing points. But >let's assume for the moment, that you are analysing a sampled, periodic >signal. Further, let p_{n,k} denote the phase of frame n and bin k (do >you understand what I mean by "frame" and "bin"?). For the periodic >signal, one phase value p_{n,k} determines the phases for all other >frames p_{n+m,k}, simply by > >p_{n+m,k} = (p_{n,k} + m N k / M) modulo 2 pi (1) > >where N = frame hop time (measured in samples) and M = frame length >(measured in samples) (equation (1) might be wrong, please check the >maths). > >So if you know p_{n+1,k} you can determine p_{n,k} from equation (1). >For speech signals (with additive noise), you can assume local >stationarity of phase in voiced sections. A least-squares estimate for >p_{n,k} is simply the average of the values you get by estimating >p_{n,k} from p_{n-1,k} and from p_{n+1,k}. Estimating missing phase >might be more difficult (impossible) in unvoiced sections (where the >phase is esentially random). > >FWIW. > >Regards, >Andor > >> I thought maybe the overlap would give some correlation that would make
it
>> possible to calculate.. >> >> Thanks for your thoughts! >> Soren > >