Deleting an F-Curve

I’m trying to delete an F-Curve. I’m aware that an F-Curve can be deleted when iterating through bpy.data.actions and using the ActionFCurves.remove method. In a case such as this, however, I’m not sure how to get to the F-Curve’s ActionFCurves.

fcurves = bpy.context.visible_fcurves[:]
for fcurve in fcurves:
    if fcurve.mute:
        #deletion code goes here

Can anyone please advise on how to delete an F-Curve in this situation? Thank you!

This was answered by Tomreggae on Blender Stack Exchange:

for fcurve in bpy.context.visible_fcurves :
    if fcurve.mute:
        action = fcurve.id_data
        action.fcurves.remove(fcurve)