How to attenuate the signal in frequency domain without disturbing the noise floor?
5 views (last 30 days)
Show older comments
I have written a code to calculate the power spectrum of a 200Hz sinusoidal signal. In frequency domain, the strength of the 200Hz component is 24dbm and the noise floor is at -15dbm. How to attenuate the signal with out affecting the noise floor at -15dbm?
close all;
clear all;
clc;
fs = 1e3; % sample freq
f = 2e2;
D = 0.3; % pulse delay times
StopTime = 1;
t = (0 : 1/fs : StopTime-1/fs)'; % signal evaluation time
N = size(t,1);
w = 0.2; % width of each pulse
yp = pulstran(t,D,@rectpuls,w);
x = (10)*sin(2*pi*f*t);
display(size(yp));
display(size(x));
z = yp.*x;
noisy_z = z + 0.5*randn(size(z));
y = xcorr(noisy_z,'biased');
display(size(y));
subplot(2,1,1);
plot(t*(1/(f*StopTime)),z);
title('Pulsed sine signal');
subplot(2,1,2);
plot(t*(1/(f*StopTime)),noisy_z);
title('Noisy signal');
l = length(t);
%%Fourier Transform:
X1 = fft(y,l);
X2 = X1(1:l/2);
X = abs(X2)/N;
%%Frequency specifications:
dF = fs/N; % hertz
f1 = 0:dF:fs/2-dF; % hertz
display(size(f1));
display(size(X));
%%Plot the spectrum:
figure;
plot(f1,(10*log10((X).^2*1e3)));
xlabel('Frequency (in hertz)');
ylabel('Power (in dbm)');
title('Autocorrelation spectrum');
grid on;
1 Comment
Wayne King
on 20 Feb 2014
Edited: Wayne King
on 20 Feb 2014
Well, right out of the gate, how are you doing this?
fs = 1e3; % sample freq
f = 2e2;
A sinusoid with a period of 1/2000 sampled at 1/1000 is going to be aliased to be DC (all zeros for sin with zero phase and all ones for a cosine with zero phase.)
Answers (0)
See Also
Categories
Find more on Digital Filter Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!