Why is my Blackman window simulation in MATLAB generating noise?

  • MATLAB
  • Thread starter Disar
  • Start date
  • Tags
    Windows
In summary, if your Windows is cracking in MATLAB, it may be due to incorrect installation, insufficient resources, outdated software, or corrupted files. To prevent this, regularly update your software and ensure sufficient memory and processing power. It is not recommended to use MATLAB with a cracked Windows, as it can affect data and analysis. To fix the issue, reinstall MATLAB following proper installation instructions and checking system requirements. If the problem persists, seek technical support.
  • #1
Disar
28
0
My Windows cracked??(MATLAB)

Helloe, I am currently trying implement a blackman window. I am simulating one dimensional echo imaging for a class project. I am going to post the code I have and hope someone can help figure out why my plot is not coming out right. My plot just seems to be a lot of noise. I should be getting 5 distinct narrow pulses very simliar to a series of impulse functions. If I have omitted any key info please let me know.
Matlab:
clear;
tau = 1e-6; % pulse duration
alpha = 5e14; % chirp rate
B = (alpha*tau)/pi; % bandwidth in Hz
dt = 1/B; % Nyquist sampling rate
dt = dt/1.2; % guard band
xc = 1000; % mean range
x0 = 100; % plus/minus x0 is target area size
c = 3e8; % speed of wave propagation
fc = 1e9; % carrier frequency

ts = 2*(xc - x0)/c; % start sampling time
tf = 2*(xc + x0)/c + tau; % end sampling time
N = 2*ceil(0.5*(tf - ts)/dt); % number of samples, Have to do 'ceil' to get an integer
t = ts + (0:N - 1)*dt; % time array
dx = c*dt/2; % range spacing
x = xc + dx*(-N/2:N/2 - 1); % range array

% Simulation
ntarget = 5; % number of targets
xn = zeros(1, ntarget); % initialize range location
fn = xn; % initialize reflectivity
xn(1) = xc; fn(1) = 0.8; % These values are arbitrary
xn(2) = xc - 0.35*x0; fn(2) = 0.5;
xn(3) = xc + 0.50*x0; fn(3) = 0.7;
xn(4) = xc - 0.90*x0; fn(4) = 1.0;
xn(5) = xc + 0.60*x0; fn(5) = 0.9;

s = zeros(1, N); % initialize echo array
for i = 1:ntarget
td = t - 2*xn(i)/c;

%****Beginning of Window Code****
ss = fn(i)*exp(j*2*pi*fc*td + j*alpha*(td.^2)).*((td >= 0) & (td <= tau));
count = 0;
for m = 1:N
if td(m) <= 0 & td(m) <= tau
count = count + 1;
y=m;
end;
end;
% s = s + 0.1*(randn(1, N) + j*randn(1, N)); % Generate noise with 0 mean and standar deviation 1

%Now the noise is added to the measured signal and a blackman window is
%multipled
s = s + ss.*[zeros(1, y-count) blackman(count)' zeros(1, N-y)];
%****End of Window Code****

end

w=[zeros(1, y-count) blackman(count)' zeros(1, N-y)];
figure;plot(w);

sb = s.*exp(-j*2*pi*fc*t); % Baseband conversion

% Synthesize Reference Signal
td = t - (2*xc)/c;
s0 = exp(j*2*pi*fc*td + j*alpha*(td.^2)).*((td >= 0) & (td <= tau));
s0b = s0.*exp(-j*2*pi*fc*t); % Baseband conversion

% Imaging
sb = fftshift(fft(fftshift(sb)));
s0b = fftshift(fft(fftshift(s0b)));F = (sb./s0b);
Fm = (sb.*conj(s0b));
f = fftshift(ifft(fftshift(F)));
fm = fftshift(ifft(fftshift(Fm)));

figure;
subplot(2, 1, 1);
plot(x, abs(f));
xlabel('Range');
ylabel('Magnitude');
title('Range Imaging');

subplot(2, 1, 2);
plot(x, abs(fm));
xlabel('Range');
ylabel('Magnitude');
title('Range Imaging using Match Filtering');
 
Last edited by a moderator:
Physics news on Phys.org
  • #2


Hello there,

Based on the code you have provided, it seems like you may be experiencing some issues with your blackman window implementation. Here are a few tips that may help you troubleshoot and improve your results:

1. Check your window size: In your code, you are using a blackman window with a size of N. However, the size of your signal is also N, which means that you are essentially multiplying your signal by a rectangular window. This could be causing the noise you are seeing in your plot. Try using a smaller window size, such as N/10 or N/20, to see if that improves your results.

2. Make sure your window is centered: When using a blackman window, it's important to make sure that the window is centered around the peak of your signal. This can be achieved by shifting the window before multiplying it with your signal. In your code, you are shifting the window after multiplying it, which could be causing some issues with the results.

3. Consider using a different window: Blackman windows are commonly used in signal processing, but they may not always be the best choice for your specific application. You may want to try using a different window, such as a Hann or Hamming window, to see if that improves your results.

4. Check your signal frequencies: It's always a good idea to check the frequency content of your signal before and after applying a window. This can help you identify any issues or discrepancies in your results.

I hope these tips are helpful in improving your results. If you are still experiencing issues, feel free to provide more information or code so that I can better assist you. Good luck with your project!
 
  • #3


Hi there,

Thank you for sharing your code and question. Based on the code, it looks like you are trying to simulate a blackman window for echo imaging. However, it seems like you are also adding some noise to your signal, which could be causing the unexpected results in your plot.

I would suggest checking your code for any errors and making sure that the noise is properly added to your signal. You can also try removing the noise and see if that makes a difference in your plot.

Additionally, I would recommend reaching out to your instructor or classmates for assistance, as they may have more insight into the specific requirements and expectations for your class project.

I hope this helps and good luck with your project!
 

1. Why did my Windows crack in MATLAB?

There could be several reasons why your Windows cracked in MATLAB. Some common reasons include incorrect installation, insufficient memory or processing power, outdated software, or corrupted files.

2. How can I prevent my Windows from cracking in MATLAB?

To prevent your Windows from cracking in MATLAB, make sure to regularly update your software, have enough memory and processing power, and ensure that your files are not corrupted. It is also important to properly install and set up MATLAB for your specific system.

3. Can I still use MATLAB if my Windows is cracked?

It is not recommended to use MATLAB if your Windows is cracked. A cracked Windows can lead to errors and malfunctions in the software, resulting in incorrect or unreliable data and analysis. It is best to fix the issue or reinstall MATLAB before using it again.

4. Will the cracked Windows affect my data and analysis in MATLAB?

Yes, a cracked Windows can affect the data and analysis in MATLAB. The software may not function properly, leading to incorrect or unreliable results. It is important to fix the issue or reinstall MATLAB to ensure accurate analysis.

5. How can I fix a cracked Windows in MATLAB?

The best way to fix a cracked Windows in MATLAB is to reinstall the software. Make sure to properly follow the installation instructions and check for any system requirements to prevent the issue from occurring again. If the issue persists, it may be due to a larger problem with your system, and you may need to seek technical support.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
7K
  • Electrical Engineering
2
Replies
43
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
7K
  • Electrical Engineering
Replies
2
Views
828
  • Programming and Computer Science
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
22K
Back
Top