Inversion algorithm based on the generalized objective functional for compressed sensing