How do you make perfect sinoids in a curve?
Here is the script that would do this (you can set the value of startX, endX and cycles' while calling drawSineWave based on frequency and increase the resolution to take it closer to the perfect sine wave.)

import bpy
import bmesh
import math

def drawSineWave(resolution, startX, endX, cycles, amplitude):

    bm = bmesh.new()    
    step = (endX - startX) / (resolution)
    cycleSteps = resolution/cycles

    x = startX    
    prevVert = None
    for i in range(0, resolution+1):
        magnitude = 2 * math.pi * (i % cycleSteps) / cycleSteps
        y = amplitude * math.sin(magnitude)

        vert = bm.verts.new([x, y, 0])
        if(prevVert != None):
            bm.edges.new([prevVert, vert])
        x += step
        prevVert = vert

    mesh = bpy.data.meshes.new('sine')
    obj = bpy.data.objects.new('sineObj', mesh)
    bpy.context.scene.objects.link(obj)
    bm.to_mesh(mesh)
    obj.select = True
    bpy.context.scene.objects.active = obj
    bpy.ops.object.convert(target='CURVE')

drawSineWave(resolution = 100, startX = 0, endX = 4, cycles = 4, amplitude = 1)