I'm trying to give fch1
to pywt.cwt
for creating coefficients but when I give that this comes with a value error as a question
samplingFreq = 100
dataPeriod = 60 # sec
numSamples = samplingFreq * dataPeriod * 3
print(numSamples)
readDataFromFile = open('input.ecg', 'rb')
datatype = np.dtype('B')
filedata = np.fromfile(readDataFromFile, datatype)
# print(filedata)
p = list(filedata)
ecgarr = np.array(p)
totSamples = len(ecgarr)
numRows = int(totSamples / numSamples)
curateData = [[0] * numSamples for i in range(numRows)]
totEntries = int(numSamples / 3)
fch1 = [[0] * 1 for i in range(totEntries)]
# Divide the total samples in sets of 'numSamples'
xcntr = 0
for x in range(0, totSamples, numSamples):
ycntr = 0
for y in range(x, (x + numSamples), 1):
curateData[xcntr][ycntr] = ecgarr[y]
ycntr = ycntr + 1
xcntr = xcntr + 1
## Convert curateData into a channels
cntr = 0
for x in range(0, numRows, 1):
cntr = 0
for y in range(1, int(numSamples / 3), 1):
#print(y)
fch1[cntr] = curateData[x][3 * (y - 1)]
# Do CWT
coef, freq = pywt.cwt(fch1, np.arange(1, 129), 'morl')
print(coef)
I'm not able to find out why I'm getting the error.
coef, freq = pywt.cwt(fch1, np.arange(1, 129), 'morl')
On the above line of code, I'm getting error. Any Help would be so appreciable. Thank you