Quick and discouraging disclaimer: I have 0 formal education in these matters, but here is my best attempt to solve this math problem
This is way more complicated then it needs to be, but here was my train of thought in solving this.
Step 1: Initially, forget about the 980 samples already taken, let's figure out how to sample 120 Hz in sync with your 500 Hz sample rate.
Step 2: The period of your 500 Hz sampling is (1/500) seconds. The period of the 120 Hz signal is (1/120) seconds.
Step 3: In order for a given frequency to be a term in the Fourier series, it needs to occur n times in the sample window, where n is a natural number.
In other words, there needs to be a whole number of waves in the sample window. To rephrase again, the sample window time must be a multiple of the signal period.
Step 4: Obviously, our sample window needs to be a multiple of the sample period, because it contains a whole number of samples.
Step 5: Therefore, the sample window time is a multiple of both the signal period and the sampling period.
Step 6: The shortest sample window in which there are an integer amount of 500 Hz samples and 120 Hz signal waves is the least common multiple of their periods.
Step 7: The least common multiple of (1/500) seconds and (1/120) seconds is (150/3000) or simply (1/20). (See Ref 1)
So a sample window (1/20) seconds long will contain an integer number of 120 Hz waves, specifically, 6.
Any sample window that is a multiple of (1/20) seconds in length will contain an integer number of 120 Hz waves as well.
An integer number of waves means that there is a Fourier term in DFT for *exactly* that frequency.
Step 8: A sample window (1/20) seconds long has 25 samples at 500 Hz.
Step 9: If you already have 980 samples, you have to add 20 more to get 1000 samples, a multiple of 25.
Step 10: 1000 samples takes 2 seconds, so 240 wavelengths at 120 Hz.
Step 11: Therefore, with 1000 time domain samples and 1000 Fourier terms, the 120 Hz is the 240th lowest frequency term.
I don't know the conventions but k is either 240 or (1000-240).
I hope I got that right.
PS. here is a link for how to bandpass filter a signal (in this case, white noise) in Matlab:
https://www.mathworks.com/matlabcentral/answers/80714
Sources:
1. rational LCM calculation
https://answers.yahoo.com/question/index?qid=20100216135925AAwqWCf)
2. Double check with google:
https://www.google.ca/search?q=sin(2*pi*120*x),+sin(2*pi*500*x)
3. LCM:
https://www.mathsisfun.com/least-common-multiple-tool.html
4. LCD:
https://www.calculatorsoup.com/calculators/math/lcd.php