之前有人发过,再次整理一下,补充资料。
http://player.youku.com/player.php/sid/XMjcxMjMyNDg0/v.swf
(好像我没有权限发视频??版主帮忙编辑一下)
YouScope ,听说是由一个15岁的小孩2007年制作的,是否使用软件辅助合
成就不知道了,获过奖,已经成为示波器XY模式测试标准。
成品是一个音频文件,使用PC播放,示波器X,Y,通道分别连接到声卡L,R输出。模拟示波器基本行,不过不是全部都可以清晰显示,我的垃圾就不行,X通道还反转,就是图像反转过来了,数字DPO可能行,
DSO就看造化了。
这里可以下载: [ur]lhttp://kapsi.fi/~jpa/stuff/other/youscope-wave.flac[/url]
基本原理就是,示波器X通道控制电子束水平偏转,Y通道控制垂直偏转,大家电压为零时,屏幕中间一个亮点。水平来说正偏左,负偏右。电压变化大,电子束移动快,轨迹暗,反之轨迹就亮。YouScope就是使用这个原理绘图,看起来有点像光栅显示,实际上线是相连的,调亮点就看到了。
下面这个视频是数字示波器演示,型号分别有HM1507-3,安捷伦MSO-X 2024A,和普源的DS1052E,前面两款还能跑,普源就洗洗睡吧。http://player.youku.com/player.php/sid/XMjc3MDg4NjI4/v.swf
下面这个是个牛叉,吃饱饭没事干的,写了个PYTHON脚本来仿真,没示波器也能玩。
http://player.youku.com/player.php/sid/XMjc3MDg5MzI0/v.swf
python文件,不过好像有bug,不能跑全,上面的youscope-wave.flac要转为WAV文件。
#!/usr/bin/env python
#
# Youcope Emulator
#
#(c)2007 Felipe Sanches
#(c)2007 Leandro Lameiro
#licensed under GNU GPL v3 or later
# A bunch of bug fixes and enhancements
# Michael Sparmann, 2009
import wave
import struct
import pygame
import sys
import math
SIZE = (500,400)
DOT1COLOR = (63,255,191)
DOT2COLOR = (15,127,47)
DOT3COLOR = (11,95,35)
DOT4COLOR = (7,31,23)
DOT5COLOR = (3,23,11)
DOT6COLOR = (1,15,5)
DOT7COLOR = (0,7,3)
GRIDCOLOR = (0,31,63)
BGCOLOR = (0,63,91)
FPS = 40
SUBFRAMES = 1
ALPHA = 223
DOTALPHA = 23
SAMPLINGRATE = 50000
wro = wave.open('youscope-wave.wav')
READ_LENGTH = SAMPLINGRATE/FPS/SUBFRAMES
pygame.init()
screen = pygame.display.set_mode(SIZE,pygame.HWSURFACE|pygame.ASYNCBLIT)
pygame.display.set_caption('YouScope XY-Demo Osciloscope Emulator')
pygame.mouse.set_visible(0)
clock = pygame.time.Clock()
dot = pygame.Surface((7,7))
dot.set_alpha(DOTALPHA)
dot.fill(BGCOLOR)
dot.fill(DOT7COLOR, pygame.Rect(0,0,7,7))
dot.fill(DOT6COLOR, pygame.Rect(1,0,5,7))
dot.fill(DOT6COLOR, pygame.Rect(0,1,7,5))
dot.fill(DOT5COLOR, pygame.Rect(1,1,5,5))
dot.fill(DOT4COLOR, pygame.Rect(2,1,3,5))
dot.fill(DOT4COLOR, pygame.Rect(1,2,5,3))
dot.fill(DOT3COLOR, pygame.Rect(2,2,3,3))
dot.fill(DOT2COLOR, pygame.Rect(3,2,1,3))
dot.fill(DOT2COLOR, pygame.Rect(2,3,3,1))
dot.fill(DOT1COLOR, pygame.Rect(3,3,1,1))
grid = pygame.Surface(SIZE)
grid.set_alpha(ALPHA)
grid.fill(BGCOLOR)
for x in range(10):
pygame.draw.line(grid, GRIDCOLOR, (x*SIZE[0]/10,0), (x*SIZE[0]/10,SIZE[0]))
for y in range(8):
pygame.draw.line(grid, GRIDCOLOR, (0 , y*SIZE[1]/8), (SIZE[0] , y*SIZE[1]/8))
pygame.draw.line(grid, GRIDCOLOR, (SIZE[0]/2,0), (SIZE[0]/2,SIZE[0]), 3)
pygame.draw.line(grid, GRIDCOLOR, (0 , SIZE[1]/2), (SIZE[0] , SIZE[1]/2), 3)
for x in range(100):
pygame.draw.line(grid, GRIDCOLOR, (x*SIZE[0]/100,SIZE[1]/2-3), (x*SIZE[0]/100,SIZE[1]/2+3))
for y in range(80):
pygame.draw.line(grid, GRIDCOLOR, (SIZE[0]/2 - 3, y*SIZE[1]/80), (SIZE[0]/2 + 3, y*SIZE[1]/80))
#pygame.mixer.music.load("youscope-soundtrack.mp3")
frame = 0;
while True:
frame = frame + 1
# if frame == 9.2*FPS: pygame.mixer.music.play()
for event in pygame.event.get():
if event.type == pygame.QUIT: sys.exit()
for sf in range(SUBFRAMES):
frames = wro.readframes(READ_LENGTH)
screen.blit(grid, (0,0))
for i in range(0,READ_LENGTH*4,4):
r = struct.unpack('hh', frames[i:i+4])
x = int(r[1]*SIZE[0]/65536) + SIZE[0]/2
y = int(-r[0]*SIZE[1]/0.8/65536) + SIZE[1]/2
screen.blit(dot, (x-3,y-3), None, pygame.BLEND_ADD);
pygame.display.flip()
clock.tick(FPS) |