I am trying to create a 2D matrix, that each datapoint is a 2D array.
/ 10 \
/ |a1_0|a2_0|a3_0|....|
|a1_1|..............|
1000 |a1_2|..............|
|...................|
\ |...................|
where a1_0, a1_1, a2_0 are all (1025, 16) array.
To my understanding, that means I have to create a matrix with shape = (10, 1000, 1025, 16). (please let me know if I'm wrong)
And all I have are a1_0, a1_1, a2_0...
So my question is how to concatenate these arrays with most efficient ways if I have to concatenate 2 numpy array into a new dimension?
I've tried np.vstack() and np.concatenate() but seem not right.
I am using a function to transfer a piece of audio into a spectrogram (which is a picture), the function will return a variable called spec, which is a (1025, 16) numpy array
Therefore, at first I was trying to do:
for a0 ~ a9, concatenate:
for a1_1 ~ a1_999, concatenate:
spec = gen_spectrogram (audio)
outwith shape :(10, 1000, 1025, 16)and then iteratively assign :out[i,j] = ...outthing, is it a numpy method?(10, 1000, 1025, 16)and then iteratively assign last 2 numbers?