How the noise in time domain affect the power in frequency domain after FFT? I am new to signal processing. And I am puzzled when studying FFT.
I create time series plus a random noise in Python:


import numpy as np
N=1000
x = np.linspace(-50,50,N)
noise = np.random.random(N)*0.1
y = np.sin(2*np.pi*x/10) + noise


Then perform FFT to the time series and get power spectrum.
But I find the spectrum is totally different when I execute my script each time. 
I know it must be the random noise's effect, which are different in different execution. However, as you can see, the sine function is periodic, so we should see clearly a signal in the power spectrum. The puzzle is, the very strong periodic "signal" is submerged in the noise in frequency domain FOR SOMETIME.

I want to know how the noise in time domain affect the noise&amp;signal in frequency domain.

Many thanks!
You have problems in defining the noise and sampling frequency. Your noise is not zero mean and your sampling rate is not well defined. Following simple Python code computes the DFT magnitude of the sine plus noise example. (Note: I'm not a python user so please modify the code as necessary)

# -*- coding: utf-8 -*-

import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import fft
import numpy.random as npr


N = 1000                # Set signal sample length

t1 = -5;                # Simulation begins at t1
t2 =  5;                # Simulation  ends  at t2
x = np.linspace(t1,t2,N);# Define the sampling grid as x[n]

Ts = (t2-t1)/N;         # Compute resulting sampling period
Fs = 1/Ts;              # Compute resulting sampling rate

noise = (npr.random(N)-0.5); # Generate ZERO MEAN uniform noise

fsin = 0.2*Fs;            # Sine Wave Frequency in [0:Fs/2]  
y = np.sin(2*np.pi*fsin*x) + noise    # Generate SINE + Noise


# Take FFT and display its MAGNITUDE
w = np.linspace(0,2,N)
waves = fft(y,N)
plt.plot(w,abs(waves))


Where the resulting plot is: