mirror of
https://github.com/BreizhHardware/cours-ISEN-MD.git
synced 2026-03-18 21:50:46 +01:00
Obisidian vault auto-backup: 07-01-2026 13:41:49 on . 5 files edited
This commit is contained in:
26
.obsidian/workspace.json
vendored
26
.obsidian/workspace.json
vendored
@@ -37,10 +37,10 @@
|
||||
"state": {
|
||||
"type": "pdf",
|
||||
"state": {
|
||||
"file": "ISEN/Réseau/CIPA4/TP/Module 4/M04 TP 01 - Communication.pdf"
|
||||
"file": "ISEN/Réseau/CIPA4/TP/Module 5/M05 TP 01 - Les commandes.pdf"
|
||||
},
|
||||
"icon": "lucide-file-text",
|
||||
"title": "M04 TP 01 - Communication"
|
||||
"title": "M05 TP 01 - Les commandes"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -219,17 +219,17 @@
|
||||
},
|
||||
"active": "8beea5ef99c3c6ed",
|
||||
"lastOpenFiles": [
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP3/TP3cipa_MARQUET.pdf",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP3/TP3_Experience3.m",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP3/TP3_Experience2.m",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP3/TP3_Experience1.m",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP3/E71marquet.wav",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP2/TP2cipa_MARQUET.pdf",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP2/~$P2cipa.docx",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP2/TP2_Experience7.m",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP2/TP2_Experience6.m",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP2/TP2_Experience5.m",
|
||||
"ISEN/Réseau/CIPA4/TP/Module 4/M04 TP 02 -Packet_Tracer-La_communication.pka~",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP4/~WRL3213.tmp",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP4/~WRD3209.tmp",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP4/TP4_Experience1.m",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP4/TP3_Experience1.m",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP4/~WRL0001.tmp",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP4/~WRD0000.tmp",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP4/~$P4cipa.doc",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP4/TP2425cipaCR.doc",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP4/DS2425cipaSACCADE.wav",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP4/DS2425cipa9.wav",
|
||||
"ISEN/Traitement du signal/CIPA4/TP/TP4/DS2425cipa8.wav",
|
||||
"ISEN/Réseau/CIPA4/TP/TP M02 Conversion.md",
|
||||
"Protocol Data Units (PDU).md",
|
||||
"ISEN/English/CIPA4/Elevator pitch.md",
|
||||
|
||||
109
ISEN/Traitement du signal/CIPA4/TP/TP4/TP4_Experience1.m
Normal file
109
ISEN/Traitement du signal/CIPA4/TP/TP4/TP4_Experience1.m
Normal file
@@ -0,0 +1,109 @@
|
||||
%% Experiment 1 : Baseband recovery from TP4cipaQ1.mat
|
||||
|
||||
clc;
|
||||
clear;
|
||||
close all;
|
||||
|
||||
%% 0) Load data
|
||||
|
||||
data = load('TP4cipaQ1.mat');
|
||||
champs = fieldnames(data);
|
||||
sig = data.(champs{1});
|
||||
sig = sig(:);
|
||||
|
||||
Fs = 96000; % Sampling frequency in Hz (given)
|
||||
Ts = 1/Fs; % Sampling period
|
||||
|
||||
N = length(sig); % Number of samples
|
||||
t = (0:N-1)*Ts; % Time axis in seconds
|
||||
|
||||
%% i) Plot y(t) over the whole duration
|
||||
|
||||
figure('Name','i) Full signal y(t)');
|
||||
plot(t, sig, 'g');
|
||||
xlabel('Time (s)');
|
||||
ylabel('Amplitude');
|
||||
title('Full signal y(t) sampled at 96 kHz');
|
||||
grid on;
|
||||
|
||||
%% ii) Plot the first 10000 samples
|
||||
|
||||
Nseg = min(10000, N); % in case the file is shorter
|
||||
t_seg = t(1:Nseg);
|
||||
sig_seg = sig(1:Nseg);
|
||||
|
||||
figure('Name','ii) First 10000 samples of y(t)');
|
||||
plot(t_seg, sig_seg, 'g');
|
||||
xlabel('Time (s)');
|
||||
ylabel('Amplitude');
|
||||
title('First 10000 samples of y(t)');
|
||||
grid on;
|
||||
|
||||
%% iii) Amplitude spectrum of y(t) (frequencies in Hz)
|
||||
|
||||
Y = fft(sig);
|
||||
magY = abs(Y); % magnitude spectrum
|
||||
|
||||
halfN = floor(N/2) + 1; % positive frequencies only
|
||||
magY_half = magY(1:halfN);
|
||||
f = (0:halfN-1) * (Fs/N); % frequency axis in Hz
|
||||
|
||||
figure('Name','iii) Amplitude spectrum of y(t)');
|
||||
plot(f, magY_half, 'g');
|
||||
xlabel('Frequency (Hz)');
|
||||
ylabel('|Y(f)|');
|
||||
title('Single-sided amplitude spectrum of y(t)');
|
||||
grid on;
|
||||
xlim([0 Fs/2]);
|
||||
|
||||
% Choose cutoff frequency for baseband, e.g. 5 kHz (adapt after seeing spectrum)
|
||||
Fc = 5000; % cutoff in Hz
|
||||
wc = 2*pi*Fc/Fs; % digital radian cutoff
|
||||
|
||||
r = 0.95; % pole radius (<1); closer to 1 => sharper LP
|
||||
|
||||
% Poles at r*exp(±j*wc) => denominator:
|
||||
a = [1, -2*r*cos(wc), r^2];
|
||||
|
||||
% Simple low-pass numerator (gain 1 - r)
|
||||
b = (1 - r) * [1, 0, 0]; % two zeros at z=0, gives LP shape
|
||||
|
||||
%% Apply the low-pass filter
|
||||
|
||||
y_filt = filter(b, a, sig);
|
||||
|
||||
%% iv) Amplitude spectrum of filtered signal (frequencies in kHz)
|
||||
|
||||
YF = fft(y_filt);
|
||||
magYF = abs(YF);
|
||||
|
||||
magYF_half = magYF(1:halfN);
|
||||
f_kHz = f / 1000; % convert frequency axis to kHz
|
||||
|
||||
figure('Name','iv) Spectrum of filtered signal');
|
||||
plot(f_kHz, magYF_half, 'g');
|
||||
xlabel('Frequency (kHz)');
|
||||
ylabel('|Y_{filt}(f)|');
|
||||
title('Single-sided amplitude spectrum of filtered signal (baseband)');
|
||||
grid on;
|
||||
xlim([0 (Fs/2)/1000]);
|
||||
|
||||
%% v) Filtered signal versus time (seconds)
|
||||
|
||||
figure('Name','v) Filtered signal y\_filt(t)');
|
||||
plot(t, y_filt, 'g');
|
||||
xlabel('Time (s)');
|
||||
ylabel('Amplitude');
|
||||
title('Filtered signal in time domain');
|
||||
grid on;
|
||||
|
||||
%% vi) First 10000 samples of filtered signal
|
||||
|
||||
y_filt_seg = y_filt(1:Nseg);
|
||||
|
||||
figure('Name','vi) First 10000 samples of filtered signal');
|
||||
plot(t_seg, y_filt_seg, 'g');
|
||||
xlabel('Time (s)');
|
||||
ylabel('Amplitude');
|
||||
title('First 10000 samples of filtered signal');
|
||||
grid on;
|
||||
Binary file not shown.
BIN
ISEN/Traitement du signal/CIPA4/TP/TP4/~$P4cipa.doc
Normal file
BIN
ISEN/Traitement du signal/CIPA4/TP/TP4/~$P4cipa.doc
Normal file
Binary file not shown.
BIN
ISEN/Traitement du signal/CIPA4/TP/TP4/~WRL0001.tmp
Normal file
BIN
ISEN/Traitement du signal/CIPA4/TP/TP4/~WRL0001.tmp
Normal file
Binary file not shown.
Reference in New Issue
Block a user