mirror of
				https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
				synced 2025-10-31 03:46:44 +01:00 
			
		
		
		
	Simple Signal Translation class working
This commit is contained in:
		
							parent
							
								
									8573449aa6
								
							
						
					
					
						commit
						ae7aba6266
					
				
					 2 changed files with 435 additions and 1 deletions
				
			
		
							
								
								
									
										410
									
								
								02_discrete_signal_translation.ipynb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										410
									
								
								02_discrete_signal_translation.ipynb
									
										
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
					@ -150,7 +150,31 @@
 | 
				
			||||||
   "execution_count": null,
 | 
					   "execution_count": null,
 | 
				
			||||||
   "metadata": {},
 | 
					   "metadata": {},
 | 
				
			||||||
   "outputs": [],
 | 
					   "outputs": [],
 | 
				
			||||||
   "source": []
 | 
					   "source": [
 | 
				
			||||||
 | 
					    "# animation\n",
 | 
				
			||||||
 | 
					    "fig = plt.figure()\n",
 | 
				
			||||||
 | 
					    "plt.suptitle(\"Travelling sine wave\")\n",
 | 
				
			||||||
 | 
					    "ax = fig.add_subplot(111,projection='3d')\n",
 | 
				
			||||||
 | 
					    "ax.set_xlabel(\"spatial distance\")\n",
 | 
				
			||||||
 | 
					    "ax.set_ylabel('temporal distance')\n",
 | 
				
			||||||
 | 
					    "ax.set_zlabel(\"amplitude\")\n",
 | 
				
			||||||
 | 
					    "l1 = ax.plot(x[0], t[0], signal(x[0], t[0], velocities), label='right moving')\n",
 | 
				
			||||||
 | 
					    "l2 = ax.plot(x[0], t[0], signal(x[0], t[0], velocities[::-1]), label='left moving')\n",
 | 
				
			||||||
 | 
					    "l3 = ax.plot(x[0], t[0], signal(x[0], t[0], 1), label='flat line')\n",
 | 
				
			||||||
 | 
					    "\n",
 | 
				
			||||||
 | 
					    "lines = [l1, l2, l3]\n",
 | 
				
			||||||
 | 
					    "\n",
 | 
				
			||||||
 | 
					    "def update(i, fig, ax):\n",
 | 
				
			||||||
 | 
					    "    ax.view_init(elev=20., azim=i)\n",
 | 
				
			||||||
 | 
					    "    \n",
 | 
				
			||||||
 | 
					    "    \n",
 | 
				
			||||||
 | 
					    "    ax.legend()\n",
 | 
				
			||||||
 | 
					    "    return fig, ax\n",
 | 
				
			||||||
 | 
					    " \n",
 | 
				
			||||||
 | 
					    "anim = FuncAnimation(fig, update, frames=np.arange(0, 360, 2), repeat=True, fargs=(fig, ax))\n",
 | 
				
			||||||
 | 
					    "anim.save('rgb_cube.gif', dpi=80, writer='imagemagick', fps=24)\n",
 | 
				
			||||||
 | 
					    "plt.show();"
 | 
				
			||||||
 | 
					   ]
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 ],
 | 
					 ],
 | 
				
			||||||
 "metadata": {
 | 
					 "metadata": {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue