Discover concise Signal Processing MATLAB ideas for students and
developers.
Process noisy ECG signals by removing baseline wander, power-line interference (50/60 Hz), and high-frequency noise using low-pass, high-pass, notch, or Savitzky-Golay filters. Visualize raw vs. cleaned signals and detect R-peaks.
Key functions/toolboxes: sgolayfilt, filter, filtfilt, designfilt, Signal Processing Toolbox
Sample Code Starter:
% Load or generate noisy ECG
x = ecg(5000); % Built-in example or load your data
t = (0:length(x)-1)/360; % fs = 360 Hz typical
% Savitzky-Golay smoothing (good for preserving peaks)
order = 3; framelen = 51; % odd length
y = sgolayfilt(x, order, framelen);
% Simple low-pass (remove high-freq noise)
[b,a] = butter(4, 40/ (360/2), 'low'); % 40 Hz cutoff
y_lp = filtfilt(b, a, x);
plot(t, x, 'b', t, y, 'r', 'LineWidth', 1.5); legend('Noisy ECG', 'Filtered');
xlabel('Time (s)'); ylabel('Amplitude');
Design low-pass FIR (window/Kaiser) and IIR (Butterworth/Chebyshev/Elliptic) filters for the same specs. Compare magnitude response, phase, group delay, impulse response, and stability.
Key functions/toolboxes: fir1, butter, cheby1, ellip, freqz, grpdelay, fvtool, Signal Processing Toolbox
Sample Code Starter:
fs = 1000; fp = 100; fs_stop = 150; Rp = 1; Rs = 60;
% FIR window method
N_fir = kaiserord([fp fs_stop]/(fs/2), [1 0], [0.01 60]);
b_fir = fir1(N_fir, fp/(fs/2), kaiser(N_fir+1));
% IIR Butterworth
[N_iir, Wn] = buttord(fp/(fs/2), fs_stop/(fs/2), Rp, Rs);
[b_iir, a_iir] = butter(N_iir, Wn);
fvtool(b_fir, 1, b_iir, a_iir, 'Fs', fs); legend('FIR', 'IIR');
Simulate amplitude modulation (AM) and frequency modulation (FM), add noise, then demodulate using envelope detection (AM) and PLL or discriminator (FM). Plot modulated, noisy, and recovered signals.
Key functions/toolboxes: modulate, demodulate, awgn, hilbert, Signal Processing / Communications Toolbox
Record or load audio, compute real-time FFT, display power spectrum, spectrogram, and detect dominant frequencies. Add GUI for live visualization.
Key functions/toolboxes: fft, spectrogram, pwelch, audioread, dsp.AudioRecorder
Apply DWT (Haar, Daubechies) to denoise signals (e.g., audio/ECG) using thresholding (soft/hard). Compare levels and mother wavelets.
Key functions/toolboxes: dwt, wavedec, wdenoise, wdencmp, Wavelet Toolbox
Implement linear/circular convolution and cross/auto-correlation. Detect signals in noise or find time delay between signals.
Key functions/toolboxes: conv, xcorr, cconv
Generate sine/square waves, sample below/above Nyquist rate, show aliasing in frequency domain using FFT.
Key functions/toolboxes: sin, square, fft, resample
Plot poles/zeros of transfer functions, analyze stability, ROC, and effect on impulse/step response.
Key functions/toolboxes: tf, zplane, impz, step, pzmap
Treat grayscale image as 2D signal; apply Gaussian/median filters, Sobel/Prewitt for edges, compare results.
Key functions/toolboxes: imfilter, fspecial, edge, imread, Image Processing Toolbox
Use LMS adaptive filter to cancel noise from primary signal using reference noise input. Show convergence of weights and error signal.
Key functions/toolboxes: dsp.LMSFilter, adaptfilt.lms, Signal Processing Toolbox
Sample Code Starter:
mu = 0.01; order = 32;
lms = dsp.LMSFilter('Length', order, 'StepSize', mu);
d = desired_signal; % noisy signal
x = reference_noise; % correlated noise
[y, e] = lms(x, d); % y = estimate of noise, e = cleaned signal
plot(d, 'b'); hold on; plot(e, 'r'); legend('Noisy', 'Cleaned');
Analyze speech signals to extract fundamental frequency (pitch) using autocorrelation or cepstrum methods, and estimate formant frequencies via LPC (Linear Predictive Coding). Visualize spectrogram, pitch contour, and formant tracks for vowel/consonant discrimination.
Key functions/toolboxes: pitch, lpc, formant, spectrogram, rceps, Audio Toolbox, Signal Processing Toolbox
Sample Code Starter:
% Load speech audio
[audioIn, fs] = audioread('speech_sample.wav'); % or use your file
% Estimate pitch (fundamental frequency)
winLen = round(0.03 * fs); % 30 ms window
overlap = round(0.02 * fs);
[pitchVal, ~] = pitch(audioIn, fs, 'Method', 'PEF', ...
'WindowLength', winLen, 'OverlapLength', overlap);
% Formant estimation using LPC (example on a short voiced segment)
segment = audioIn(1:fs*0.1); % first 0.1s
order = 12; % typical for speech
A = lpc(segment, order);
rootsA = roots(A);
formants = sort(abs(rootsA(rootsA > 0 & imag(rootsA) > 0))) * (fs/(2*pi));
% Plot
t = (0:length(audioIn)-1)/fs;
subplot(2,1,1); plot(t, audioIn); title('Speech Signal');
subplot(2,1,2); plot(t(1:length(pitchVal)), pitchVal); title('Pitch Contour (Hz)');
disp('Estimated Formants (Hz):'); disp(formants(1:3));
Simulate an OFDM transmitter/receiver chain modeling 5G NR basics: subcarrier mapping, IFFT/FFT, cyclic prefix addition, AWGN channel, and BER calculation. Compare performance with different modulation orders (QPSK/16QAM).
Key functions/toolboxes: ofdmmod, ofdmdemod, comm.AWGNChannel, qammod, qamdemod, Communications Toolbox (or 5G Toolbox for nrOFDMModulate)
Sample Code Starter:
% Basic OFDM parameters
N = 64; % FFT size (subcarriers)
CP = 16; % Cyclic prefix length
M = 4; % QPSK
data = randi([0 M-1], N, 1);
modData = qammod(data, M, 'UnitAveragePower', true);
% IFFT + add CP
ifftSig = ifft(modData, N);
cpSig = [ifftSig(end-CP+1:end); ifftSig];
% Channel (simple AWGN)
snr = 10; % dB
rxSig = awgn(cpSig, snr, 'measured');
% Remove CP + FFT
rxNoCP = rxSig(CP+1:end);
demodData = fft(rxNoCP, N);
% Demodulate and calculate BER
rxBits = qamdemod(demodData, M, 'UnitAveragePower', true);
ber = mean(data ~= rxBits);
disp(['BER at SNR = ' num2str(snr) ' dB: ' num2str(ber)]);
Generate a linear FM (chirp) pulse, simulate target echoes with delay and noise, then apply matched filtering (time-reversed conjugate) for pulse compression to improve range resolution and SNR.
Key functions/toolboxes: chirp, conv, xcorr, phased.LinearFMWaveform, Radar Toolbox / Signal Processing Toolbox
Sample Code Starter:
fs = 1e6; T = 10e-6; B = 100e3; % pulse width, bandwidth
t = 0:1/fs:T-1/fs;
pulse = chirp(t, 0, T, B); % linear FM chirp
% Simulate echo with delay and noise
delay = round(2e-6 * fs); % target at 300 m range approx
echo = [zeros(1,delay) pulse zeros(1,500)];
echoNoisy = awgn(echo, 10, 'measured');
% Matched filter = time-reversed conjugate
mf = fliplr(conj(pulse));
compressed = conv(echoNoisy, mf, 'same');
% Plot
plot(abs(compressed)); title('Pulse Compressed Output'); xlabel('Samples');
Remove common EEG artifacts (eye blinks, muscle noise, power-line interference) using wavelet denoising, ICA, or adaptive filtering. Compare before/after signals and power spectra.
Key functions/toolboxes: wdenoise, icatool (EEGLAB), eegfiltnew, Wavelet Toolbox, Signal Processing Toolbox
Sample Code Starter:
% Assume eegData is your multi-channel EEG matrix
load eeg_example.mat; % or use your data
% Wavelet denoising (example on channel 1)
level = 5; wname = 'db4';
denoised = wdenoise(eegData(:,1), level, 'Wavelet', wname, ...
'DenoisingMethod', 'SURE', 'ThresholdRule', 'soft');
% Simple high-pass to remove baseline
[b,a] = butter(4, 1/(fs/2), 'high'); % fs = sampling rate
cleaned = filtfilt(b, a, denoised);
plot(eegData(:,1), 'b'); hold on; plot(cleaned, 'r');
legend('Raw EEG', 'Artifact Removed');
Detect dominant frequencies in monophonic music audio, estimate pitch/note using FFT peak finding or autocorrelation, and map to musical notes (A4=440 Hz reference). Display note sequence over time.
Key functions/toolboxes: pitch, fft, findpeaks, audioread, Audio Toolbox
Sample Code Starter:
[audio, fs] = audioread('music_clip.wav');
winLen = round(0.05 * fs); % 50 ms window
% Pitch estimation over time
[pitchEst, time] = pitch(audio, fs, 'Method', 'SRH', ...
'WindowLength', winLen);
% Simple FFT-based single-note detection example
Y = fft(audio(1:winLen));
f = (0:winLen-1)*(fs/winLen);
[~, idx] = max(abs(Y(1:winLen/2)));
freq = f(idx);
note = 69 + 12 * log2(freq / 440); % MIDI note number
disp(['Detected frequency: ' num2str(freq) ' Hz']);
Implement QPSK or M-QAM modulation, transmit through AWGN channel at varying SNR, demodulate, and plot BER curve. Compare theoretical vs simulated performance.
Key functions/toolboxes: qammod, qamdemod, awgn, berawgn, Communications Toolbox
Sample Code Starter:
M = 16; % 16-QAM
data = randi([0 M-1], 10000, 1);
modSig = qammod(data, M, 'UnitAveragePower', true);
snr = 0:2:20;
ber = zeros(size(snr));
for i = 1:length(snr)
rx = awgn(modSig, snr(i), 'measured');
demod = qamdemod(rx, M, 'UnitAveragePower', true);
ber(i) = mean(data ~= demod);
end
semilogy(snr, ber, 'b-o'); hold on;
semilogy(snr, berawgn(snr, 'qam', M), 'r--');
legend('Simulated', 'Theoretical'); xlabel('SNR (dB)'); ylabel('BER');
Design analog/digital Butterworth and Chebyshev Type I/II low-pass filters for given specs (passband ripple, stopband attenuation). Compare responses using fvtool.
Key functions/toolboxes: butter, cheby1, cheby2, ellip, freqz, fvtool, Signal Processing Toolbox
Sample Code Starter:
[b_butt, a_butt] = butter(5, 0.2); % order 5, cutoff 0.2*pi
[b_cheb1, a_cheb1] = cheby1(5, 1, 0.2); % 1 dB ripple
fvtool(b_butt, a_butt, b_cheb1, a_cheb1);
legend('Butterworth', 'Chebyshev Type I');
Build a parametric equalizer (low/high shelf + peaking filters) using GUI sliders for gain/frequency/Q. Process live or file audio in real-time and visualize frequency response.
Key functions/toolboxes: dsp.ParametricEQFilter, dsp.AudioPlayer, audioread, uicontrol / App Designer
Apply 2D discrete wavelet transform (DWT) to grayscale image, threshold coefficients, reconstruct, and calculate compression ratio vs PSNR/quality loss.
Key functions/toolboxes: dwt2, idwt2, wthresh, appcoef2, Wavelet Toolbox, Image Processing Toolbox
Sample Code Starter:
I = imread('cameraman.tif'); level = 2; wname = 'haar';
[C, S] = wavedec2(I, level, wname);
% Threshold small coefficients
Cthresh = wthresh(C, 'h', 30); % hard threshold example
Icomp = waverec2(Cthresh, S, wname);
imshowpair(I, uint8(Icomp), 'montage');
psnrVal = psnr(Icomp, double(I));
disp(['PSNR: ' num2str(psnrVal) ' dB']);
Simulate 2x2 MIMO Rayleigh fading channel, apply spatial multiplexing or Alamouti space-time coding, add noise, equalize (ZF/MMSE), and compute BER vs SNR.
Key functions/toolboxes: comm.MIMOChannel, comm.RayleighChannel, comm.ZFEqualizer, qammod, Communications Toolbox
Sample Code Starter:
% Simple 2x2 MIMO example
Nt = 2; Nr = 2; M = 4;
data = randi([0 M-1], 1000, Nt);
txSig = qammod(data, M);
chan = comm.MIMOChannel('SampleRate', 1e6, 'PathDelays', 0, ...
'AveragePathGains', 0, 'MaximumDopplerShift', 5);
rxSig = chan(txSig);
snr = 15;
rxNoisy = awgn(rxSig, snr, 'measured');
% Zero-forcing equalization (simple pseudo-inverse)
Hest = eye(Nr,Nt); % assume perfect CSI
equalized = (Hest \ rxNoisy.')';
Analyze respiratory signals (e.g., nasal airflow or chest movement) to detect apnea events: identify pauses longer than 10-20 seconds, classify central/obstructive apnea using amplitude and frequency features, and mark events on the time series.
Key functions/toolboxes: findpeaks, movmean, envelope, Signal Processing Toolbox
Sample Code Starter:
% Assume resp_signal is your breathing waveform, fs = sampling rate
load breathing_data.mat; % or use your file
t = (0:length(resp_signal)-1)/fs;
% Smooth and find envelope
env = envelope(resp_signal, round(0.5*fs), 'rms'); % 0.5s window
smooth_env = movmean(env, round(2*fs)); % 2s moving average
% Detect apnea: periods where envelope drops below threshold
thresh = 0.3 * mean(smooth_env);
apnea_mask = smooth_env < thresh;
% Find start/end of apnea events (>10s)
[pks, locs] = findpeaks(double(~apnea_mask), 'MinPeakDistance', fs*5);
apnea_starts = locs(diff([0; locs]) > fs*10); % events >10s
% Plot
plot(t, resp_signal, 'b'); hold on;
plot(t, smooth_env, 'g', 'LineWidth', 2);
plot(t(apnea_mask), resp_signal(apnea_mask), 'r.', 'MarkerSize', 10);
title('Breathing Signal with Detected Apnea Events');
legend('Raw Signal', 'Envelope', 'Apnea Regions');
Model and compare different Pulse Width Modulation techniques (Sinusoidal PWM, Third Harmonic Injection, Space Vector PWM) in Simulink for inverter control. Analyze harmonic content, THD, and switching losses.
Key functions/toolboxes: Simulink + PWM Generator (Multilevel), Power Electronics Toolbox / Simscape Electrical
Sample Code Starter (MATLAB script to generate SPWM reference):
fs = 10000; % Switching frequency
fm = 50; % Fundamental frequency
ma = 0.9; % Modulation index
t = 0:1/fs:0.02;
% Sinusoidal PWM reference
ref_sin = ma * sin(2*pi*fm*t);
% Third Harmonic Injection
ref_thi = ref_sin + (1/6) * sin(6*pi*fm*t);
% Plot references
plot(t*1000, ref_sin, 'b', t*1000, ref_thi, 'r--', 'LineWidth', 1.5);
legend('Sinusoidal PWM', 'Third Harmonic Injection');
xlabel('Time (ms)'); ylabel('Normalized Reference');
title('PWM Reference Signals Comparison');
Process LiDAR point cloud or range data: filter noise, detect obstacles via thresholding or clustering, estimate distance and angle, and visualize in polar/cartesian coordinates.
Key functions/toolboxes: pcdenoise, findpeaks, polarplot, lidarPointCloud (if available), Signal Processing Toolbox
Sample Code Starter:
% Simulated LiDAR scan: angles and ranges
theta = linspace(-pi, pi, 360); % 1-degree resolution
ranges = 5 + 2*randn(size(theta)); % background at ~5m
ranges(100:150) = 1.5; % obstacle at 1.5m in sector
% Simple threshold-based detection
obstacle_mask = ranges < 3; % closer than 3m
% Find clusters (basic)
[~, locs] = findpeaks(-ranges, 'MinPeakProminence', 1);
% Plot polar
figure; polarplot(theta, ranges, 'b');
hold on; polarplot(theta(obstacle_mask), ranges(obstacle_mask), 'r.');
title('LiDAR Scan - Obstacle Detection');
legend('All Points', 'Detected Obstacles');
Design a receiver that separates multiple overlapping signals in time-frequency domain using multi-level DWT decomposition, coefficient selection, and reconstruction for individual signals (e.g., FDM-like separation).
Key functions/toolboxes: wavedec, waverec, appcoef, detcoef, wrcoef, Wavelet Toolbox
Sample Code Starter:
% Superimposed signals example
t = 0:0.001:1;
s1 = sin(2*pi*50*t); % low freq
s2 = 0.5*sin(2*pi*200*t); % high freq
x = s1 + s2 + 0.2*randn(size(t));
% Multi-level DWT
[c, l] = wavedec(x, 5, 'db4');
% Approximate coefficients (low freq) β s1
a5 = appcoef(c, l, 'db4', 5);
s1_rec = wrcoef('a', c, l, 'db4', 5);
% Detail coefficients at certain level β s2 approximation
d3 = detcoef(c, l, 3);
s2_rec = wrcoef('d', c, l, 'db4', 3);
% Plot
subplot(3,1,1); plot(t, x); title('Composite Signal');
subplot(3,1,2); plot(t, s1_rec); title('Recovered Low-Freq Signal');
subplot(3,1,3); plot(t, s2_rec); title('Recovered High-Freq Component');
Investigate quantization noise, overflow handling, and performance degradation in fixed-point implementations of DSP algorithms for wireless receivers (e.g., FIR filters, equalizers). Compare fixed-point vs floating-point BER or EVM in simulated communication links.
Key toolboxes: Fixed-Point Designer, DSP System Toolbox, Communications Toolbox
Sample Code Starter:
% Fixed-point FIR filter example
wl = 16; fl = 10; % word length, fraction length
x = fi(randn(1, 5000), 1, wl, fl); % signed fixed-point input
% Filter coefficients in fixed-point
b = fi([0.05 0.15 0.6 0.15 0.05], 1, wl, fl);
% Fixed-point filtering (using filter with fi objects)
y_fixed = filter(double(b), 1, double(x)); % simulate fixed behavior
% Floating-point reference
y_float = filter(double(b), 1, double(x));
% Quantization error
error = double(y_fixed) - y_float;
% Plot
subplot(2,1,1); plot(double(y_fixed), 'b'); hold on; plot(y_float, 'r--');
legend('Fixed-Point', 'Floating-Point');
subplot(2,1,2); plot(error); title('Quantization Error');
Multimodal AI is one of the most exciting frontiers in artificial ...
Learn MoreIn the era of renewable energy transition, microgrids...
Learn MoreβI got full marks on my MATLAB assignment! The solution was perfect and delivered well before the deadline. Highly recommended!β
βQuick delivery and excellent communication. The team really understood the problem and provided a great solution. Will use again.β
Explore how MATLAB Solutions has helped clients achieve their academic and research goals through practical, tailored assistance.
In today\\\'s rapidly advancing era of automation, robotics control systems are evolving to meet the demand for smarter, faster, and more reliable performance. Among the many innovations driving this transformation is the use of MCP (Model-based Control Paradigms)
The financial sector is witnessing a technological revolution with the rise of Large Language Models (LLMs). Traditionally used for text analysis, LLMs are now being integrated with powerful platforms like MATLAB to develop financial forecasting models