I have applied transformation(Constant Q Transformation) to my audio time domain signal, this gives me Frequency vs Time representation. Now, the CQT values consists of complex values(84*260), but python makes use of only magnitude values to plot. I saved obtained spectrogram as .png image, to do some image processing work. So when i read this saved image I get 224*341*3.
After Image processing work, Now I want to reconstruct back my audio time domain signal to check my work. To reconstruct back to audio domain time signal, first i will read the image, when i read my image I get 224*341*3 values.
I have the phase information of 84*260 resulted from CQT in the beginning. I know we have to make use of phase information to reconstruct the signal. S=Magnitude * Phase.
How would one really reconstruct back the audio signal with this criteria.
Am i doing anything wrong. Has people came across same situations?
I am using Python and librosa library for all the operations.
I know librosa icqt has existing bug. Even if I do reconstruction in matlab, how would i tackle the different dimensions. Hope its clear now.
#load the audio data_aud,sr_aud = librosa.core.load(path) #find the cqt cqt = librosa.core.cqt(data_aud, sr=44100, hop_length=512, n_bins=84, bins_per_octave=12, tuning=None, norm=1, sparsity=0.01, window='hann', scale=True, pad_mode='reflect') #take the phase information mag, phase = librosa.core.magphase(cqt,power = 1) #save the fig a_add=librosa.display.specshow(cqt, sr= 44100) plt.axis('off') plt.savefig(path,transparent = True, bbox_inches = 'tight', pad_inches = 0) #image processing img = cv2.imread(path,1) gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) #multiply the image data with phase???? #reconstruct y =librosa.core.icqt(imageData, sr=44100, hop_length=512, fmin=None, bins_per_octave=12, tuning=None, filter_scale=1, norm=1, sparsity=0.01, window='hann', scale=True, amin=1e-06)