I want to use cos()
function in my code to make my own signal source, but i don't know how to get the output with both the quadrature phase too EXACTLY like what a built-in signal source outputs.
Can anyone please help me with the python code to make a signal source using Python Module in flow graph.
DETAILS:
The code i wrote is:
def work(self, input_items, output_items):
fs_local = 30e6;
for i in range(0, fs_local):
output_items[0][i]= math.cos(2*pi*(math.pi)/fs_local)
return len(output_items[0])
The problem is that output items length is perhaps by default fixed to be 4096. so any range in for loop not equal to output_items(i.e. for i in range(0, len(output_items[0]) or input_items(disabled in my case) is not going to work and does not show any output. And if i use output_items length exactly as i wrote in above paragraph, then it will truncate the range to 4096 and thus outputs a ramp which is not my desired output.
Similarly not returning "len(output_items[0])" and instead returning "len(fs_local) won't show any results either.
Also how to output a 90 degree shifted cos wave too along with correctly outputting the cosine wave itself just like a built-in signal source?