spkit.phase_map_reconstruction

spkit.phase_map_reconstruction(X, add_sig=False, amp_shift=1, amp_mult=0, cleaning_phase=True, w=1, mollier=True, window_length=51, iterations=1, verbose=False)

Phase Mapping and Amplitude Equalization

Phase Mapping of multi channel signals X along with reconstruction of signal by amplitude substraction

Note

for more details

Check amplitude_equalizer

Parameters:
X(n,ch)
  • multichannel signal, shape= (samples, n_channels)

add_sig: bool,
  • if True, signal is added to compute phase

  • check phase_map for details

amp_mult: scalar [0,1]
  • multiplication factor for original amplitude

amp_shift: scalar
  • shifting factor for amplitude

  • new_amplitude = (amp_mult*old_amplitude + amp_shift)

cleaning_phase: bool, default=True
w: float
  • used for phase cleaning,

  • if w<=0, then no phase cleaning is applied

Mollifier parameters:
  • mollier: bool,default=True,
    • If True, recostructed signal is smooth out using mollier

    • mollier is good to removed suddon peaks and artifacts.

    • check filter_smooth_mollifier for details

  • if True, following parameters are used
    • window_length:int, deatult=51,

    • iterations: deault=1,

    • (s,p,r): default None

Returns:
XP(n,ch)
  • Instantenious Phase, shape=(samples, n_channels),

XE(n,ch)
  • Reconstructed Equalized Signal shape=(samples, n_channels)

See also

clean_phase, phase_map, dominent_freq, dominent_freq_win, amplitude_equalizer

Notes

NOTE: Under testing and development

Examples

    #sp.phase_map_reconstruction
    import numpy as np
    import matplotlib.pyplot as plt
    import spkit as sp
    x,fs = sp.data.optical_sample(sample=1)
    x = x[int(0*fs):int(2*fs)]
    x = sp.filterDC_sGolay(x,window_length=fs//2+1)
    t = np.arange(len(x))/fs
    xp, xe = sp.phase_map_reconstruction(x)
    plt.figure(figsize=(10,5))
    plt.subplot(311)
    plt.plot(t,x)
    plt.ylabel(r'$x(t)$')
    plt.xlim([t[0],t[-1]])
    plt.grid()
    plt.title('Amplitude Equalization')
    plt.subplot(312)
    plt.plot(t,xp)
    plt.xlim([t[0],t[-1]])
    plt.ylabel(r'$\phi(t)$')
    plt.grid()
    plt.subplot(313)
    plt.plot(t,xe)
    plt.xlim([t[0],t[-1]])
    plt.ylabel(r'$x_e(t)$')
    plt.xlabel('time (s)')
    plt.grid()
    plt.subplots_adjust(hspace=0)
    plt.tight_layout()
plt.show()