Use len(sig) instead of sig.shape()[0]