close all; %Define number of samples to take fs = 8000; f = 400; %Hz %Define signal t = 0:1/fs:1-1/fs; signal = sin(2*pi*f*t); %Plot to illustrate that it is a sine wave plot(t, signal); title('Time-Domain signal'); %Take fourier transform fftSignal = fft(signal); %apply fftshift to put it in the form we are used to (see documentation) fftSignal = fftshift(fftSignal); %Next, calculate the frequency axis, which is defined by the sampling rate f = fs/2*linspace(-1,1,fs); %Since the signal is complex, we need to plot the magnitude to get it to %look right, so we use abs (absolute value) figure; plot(f, abs(fftSignal)); title('magnitude FFT of sine'); xlabel('Frequency (Hz)'); ylabel('magnitude'); %noise noise = 2*randn(size(signal)); figure, plot(t,noise), title('Time-Domain Noise'); fftNoise = fft(noise); fftNoise = fftshift(fftNoise); figure, plot(f,abs(fftNoise)), title('Magnitude FFT of noise'); xlabel('Frequency (Hz)'); ylabel('magnitude'); %noisy signal noisySignal = signal + noise; figure, plot(t,noisySignal), title('Time-Domain Noisy Signal'); fftNoisySignal = fft(noisySignal); fftNoisySignal = fftshift(fftNoisySignal); figure, plot(f,abs(fftNoisySignal)), title('Magnitude FFT of noisy signal'); xlabel('Frequency (Hz)'); ylabel('magnitude');
fftNoisySignal = fft(NoisySignal)./numel(NoisySignal);
Maybe that is the case, basically the magnitude of the fft has an issue, I guess! You need to apply this division on every fft command you use.
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.