Sparse Coding For Data-driven Coherent And Incoherent Noise Attenuation