f2 = linspace(-fs/2,fs/2,length(x));
f1 = transpose(f2(end/2+1:end));
freq = transpose([10.7e9 11.213e9 11.725e9 12.238e9 12.75e9]);
fs/2 = 5e11
length(x) = 1048576
I am looking for the entries of f1 corresponding to all frequencies between min(freq) and max(freq). I was thinking to achieve this with:
But this gives the error: "Index exceeds matrix dimensions".
So for example, entries 11219,11220,11221 of f1 are:
- 10698805521,7795 rounded to 1.0699e+10
- 10699759197,0054 rounded to 1.0700e+10
- 10700712872,2314 rounded to 1.0701e+10
So apparently there is no entry of f1 equal to min(freq) = 10.7e9. So, two questions: First: Can I make f1 have frequencies ranging from min(freq) to max(freq) in steps of 0.001e9 just by changing length(x) ? I mean these frequencies have to be within the range of f1, but f1 is also allowed to have smaller and/or higher frequencies.
Second: If there is no such way to achieve my first question, how do I at least find the closest frequencies of f1 corresponding to frequencies between min(freq) and max(freq) ? In the example given, this would be entry 11220 of f1.
Thanks for help!!