forked from acco/chti23
		
	matlab aveclive script
This commit is contained in:
		
							parent
							
								
									15cdcee56f
								
							
						
					
					
						commit
						7f62cad9a7
					
				
					 4 changed files with 26 additions and 16 deletions
				
			
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							|  | @ -108,3 +108,4 @@ RTE | ||||||
| 
 | 
 | ||||||
| # To explicitly override the above, define any exceptions here; e.g.: | # To explicitly override the above, define any exceptions here; e.g.: | ||||||
| # !my_customized_scatter_file.sct | # !my_customized_scatter_file.sct | ||||||
|  | *.slprj | ||||||
|  | @ -1,31 +1,40 @@ | ||||||
| clear all; | clear all; | ||||||
| close all; | close all; | ||||||
|  | %% Paramêtres utilisatrice | ||||||
|  | %  | ||||||
| 
 | 
 | ||||||
| %% Paramètres | T = 0.25;               % Fenêtre d'observation [s] | ||||||
| T = 0.25;               % Fenêtre d'observation | M=32;                   % Nombre d'échantillons dans la fenêtre | ||||||
| M=32;                   % Nombre d'échantillons dans la fenêtre | Fsin = 4 ;              % Fréquence d'un sinus [Hz] | ||||||
| 
 | %% Paramêtres déduits | ||||||
| 
 |  | ||||||
| %% Paramètres déduits |  | ||||||
| Te = T/M;               % Période d'échantillonnage |  | ||||||
| Tsim = T-Te;            % Instant final de simulation |  | ||||||
| Fsin = 4 ; |  | ||||||
| %% Calculs préliminaires  |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
|  | Te = T/M;               % Période d'échantillonnage [s] | ||||||
|  | Tsim = T-Te;            % Instant final de simulation avec M points [s]  | ||||||
|  | fprintf("Fréquence = %f Hz", 1/Te) | ||||||
|  | %% Calculs préliminaires | ||||||
| %% Lancement de simulink | %% Lancement de simulink | ||||||
| out=sim("simDFT") |  | ||||||
| 
 | 
 | ||||||
|  | tic | ||||||
|  | out=sim("simDFT");  | ||||||
|  | toc | ||||||
| %% Visualisations temporelle | %% Visualisations temporelle | ||||||
|  | 
 | ||||||
| plot(out.sin_continu,'.-'); | plot(out.sin_continu,'.-'); | ||||||
| hold on; | hold on; | ||||||
| plot(out.sin_echanti,'o'); |  | ||||||
| grid on; |  | ||||||
| 
 | 
 | ||||||
|  | t =   out.sin_echanti.Time; | ||||||
|  | sig = out.sin_echanti.Data; | ||||||
|  | 
 | ||||||
|  | stem(t, sig , 'o'); | ||||||
|  | grid on; | ||||||
| %% Calcul DFT | %% Calcul DFT | ||||||
| 
 | 
 | ||||||
|  | Tfd = fft(sig); | ||||||
|  | abscisses=1:length(Tfd);  | ||||||
| 
 | 
 | ||||||
| %% visualisation DFT | %% visualisation DFT | ||||||
| figure(); |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
|  | figure() | ||||||
|  | plot(abscisses,abs(Tfd),'o-'); | ||||||
|  | ylabel("Module Transformée de Fourier") | ||||||
|  | xlabel("???  indices de tableau Matlab de 1 à 32 ???") | ||||||
							
								
								
									
										
											BIN
										
									
								
								signal/matlab/scriptDFT.mlx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								signal/matlab/scriptDFT.mlx
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
		Loading…
	
		Reference in a new issue